@@ 255-264 (lines=10) @@ | ||
252 | * @param string $attributeName |
|
253 | * @return boolean |
|
254 | */ |
|
255 | public function hasAttribute($attributeName) { |
|
256 | if (isset($this->document['data']['attributes']) === false) { |
|
257 | return false; |
|
258 | } |
|
259 | if (array_key_exists($attributeName, $this->document['data']['attributes']) === false) { |
|
260 | return false; |
|
261 | } |
|
262 | ||
263 | return true; |
|
264 | } |
|
265 | ||
266 | /** |
|
267 | * @param string $attributeName |
|
@@ 278-287 (lines=10) @@ | ||
275 | * @param string $relationshipName |
|
276 | * @return boolean |
|
277 | */ |
|
278 | public function hasRelationship($relationshipName) { |
|
279 | if (isset($this->document['data']['relationships']) === false) { |
|
280 | return false; |
|
281 | } |
|
282 | if (array_key_exists($relationshipName, $this->document['data']['relationships']) === false) { |
|
283 | return false; |
|
284 | } |
|
285 | ||
286 | return true; |
|
287 | } |
|
288 | ||
289 | /** |
|
290 | * @todo return some kind of read-only ResourceIdentifierObject |