-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #45 from swisnl/feature/improve-relations
Refactor relations
- Loading branch information
Showing
16 changed files
with
204 additions
and
275 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
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
|
||
namespace Swis\JsonApi\Client\Interfaces; | ||
|
||
use Swis\JsonApi\Client\Collection; | ||
|
||
interface ManyRelationInterface | ||
{ | ||
/** | ||
* @param \Swis\JsonApi\Client\Collection $included | ||
* | ||
* @return static | ||
*/ | ||
public function associate(Collection $included); | ||
|
||
/** | ||
* @return static | ||
*/ | ||
public function dissociate(); | ||
|
||
/** | ||
* @return bool | ||
*/ | ||
public function hasIncluded(): bool; | ||
|
||
/** | ||
* @return \Swis\JsonApi\Client\Collection | ||
*/ | ||
public function getIncluded(): Collection; | ||
|
||
/** | ||
* @param bool $omitIncluded | ||
* | ||
* @return static | ||
*/ | ||
public function setOmitIncluded(bool $omitIncluded); | ||
|
||
/** | ||
* @return bool | ||
*/ | ||
public function shouldOmitIncluded(): bool; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace Swis\JsonApi\Client\Interfaces; | ||
|
||
interface TypedRelationInterface | ||
{ | ||
/** | ||
* @return string | ||
*/ | ||
public function getType(): string; | ||
|
||
/** | ||
* @param string $type | ||
* | ||
* @return static | ||
*/ | ||
public function setType(string $type); | ||
} |
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
Oops, something went wrong.