-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add more accessors and mutators for ResourceObject
- Loading branch information
1 parent
1fcf20d
commit fb53960
Showing
3 changed files
with
142 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,6 +38,35 @@ public function __construct(string $type, string $id = "") | |
$this->relationships = []; | ||
} | ||
|
||
public function type(): string | ||
{ | ||
return $this->type; | ||
} | ||
|
||
public function setType(string $type): ResourceObject | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
kocsismate
Author
Member
|
||
{ | ||
$this->type = $type; | ||
|
||
return $this; | ||
} | ||
|
||
public function id(): string | ||
{ | ||
return $this->id; | ||
} | ||
|
||
public function setId(string $id): ResourceObject | ||
{ | ||
$this->id = $id; | ||
|
||
return $this; | ||
} | ||
|
||
public function attributes(): array | ||
{ | ||
return $this->attributes; | ||
} | ||
|
||
public function setAttributes(array $attributes): ResourceObject | ||
{ | ||
$this->attributes = $attributes; | ||
|
@@ -55,6 +84,14 @@ public function setAttribute(string $name, $value): ResourceObject | |
return $this; | ||
} | ||
|
||
/** | ||
* @return RelationshipInterface[] | ||
*/ | ||
public function relationships(): array | ||
{ | ||
return $this->relationships; | ||
} | ||
|
||
public function setToOneRelationship(string $name, ToOneRelationship $relationship): ResourceObject | ||
{ | ||
return $this->setRelationship($name, $relationship); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Is there a specific reason you use
ResourceObject
as return type and notself
?