2
2
3
3
namespace Art4 \JsonApiClient ;
4
4
5
+ use Art4 \JsonApiClient \Utils \AccessAbstract ;
5
6
use Art4 \JsonApiClient \Utils \AccessTrait ;
6
7
use Art4 \JsonApiClient \Utils \FactoryManagerInterface ;
7
8
use Art4 \JsonApiClient \Resource \ResourceInterface ;
13
14
*
14
15
* @see http://jsonapi.org/format/#document-resource-object-relationships
15
16
*/
16
- class RelationshipCollection implements AccessInterface
17
+ class RelationshipCollection extends AccessAbstract
17
18
{
18
19
use AccessTrait;
19
20
@@ -75,7 +76,7 @@ public function __construct($object, FactoryManagerInterface $manager, ResourceI
75
76
*
76
77
* @return bool true if the value is set, false if not
77
78
*/
78
- public function has ($ key )
79
+ protected function hasValue ($ key )
79
80
{
80
81
return array_key_exists ($ key , $ this ->_data );
81
82
}
@@ -93,18 +94,18 @@ public function getKeys()
93
94
/**
94
95
* Get a value
95
96
*
96
- * @param string $name The Name
97
+ * @param string $key The Key
97
98
*
98
99
* @return mixed The value
99
100
*/
100
- public function get ( $ name )
101
+ protected function getValue ( $ key )
101
102
{
102
- if ( ! $ this ->has ($ name ) )
103
+ if ( ! $ this ->has ($ key ) )
103
104
{
104
- throw new AccessException ('" ' . $ name . '" doesn \'t exist in this relationship collection. ' );
105
+ throw new AccessException ('" ' . $ key . '" doesn \'t exist in this relationship collection. ' );
105
106
}
106
107
107
- return $ this ->_data [$ name ];
108
+ return $ this ->_data [$ key ];
108
109
}
109
110
110
111
/**
0 commit comments