-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathRelationshipInterface.php
More file actions
50 lines (42 loc) · 1.26 KB
/
RelationshipInterface.php
File metadata and controls
50 lines (42 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
declare(strict_types=1);
namespace Enm\JsonApi\Model\Resource\Relationship;
use Enm\JsonApi\Model\Common\KeyValueCollectionInterface;
use Enm\JsonApi\Model\Resource\Link\LinkCollectionInterface;
use Enm\JsonApi\Model\Resource\ResourceCollectionInterface;
/**
* @author Philipp Marien <marien@eosnewmedia.de>
*/
interface RelationshipInterface
{
/**
* Indicates if the contained data should be handled as object collection or single object
*
* @return bool
*/
public function shouldBeHandledAsCollection(): bool;
/**
* @return string
*/
public function name(): string;
/**
* @return ResourceCollectionInterface
*/
public function related(): ResourceCollectionInterface;
/**
* @return LinkCollectionInterface
*/
public function links(): LinkCollectionInterface;
/**
* @return KeyValueCollectionInterface
*/
public function metaInformation(): KeyValueCollectionInterface;
/**
* Creates a new relationship containing all data from the current one.
* If set, the new relationship will have the given name.
*
* @param string|null $name
* @return RelationshipInterface
*/
public function duplicate(string $name = null): RelationshipInterface;
}