Total Complexity | 9 |
Total Lines | 58 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
16 | class ODataExpandedResult |
||
17 | { |
||
18 | /** |
||
19 | * Term. |
||
20 | * |
||
21 | * @var ODataContainerBase|null |
||
22 | */ |
||
23 | private $data; |
||
24 | |||
25 | /** |
||
26 | * ODataExpandedResult constructor. |
||
27 | * |
||
28 | * @param ODataContainerBase|null $data |
||
29 | */ |
||
30 | public function __construct(ODataContainerBase $data = null) |
||
31 | { |
||
32 | $this->{$data instanceof ODataEntry ? 'setEntry' : 'setFeed'}($data); |
||
33 | } |
||
34 | |||
35 | /** |
||
36 | * @return ODataEntry|null |
||
37 | */ |
||
38 | public function getEntry(): ?ODataEntry |
||
41 | } |
||
42 | |||
43 | /** |
||
44 | * @param ODataEntry|null $entry |
||
45 | * @return ODataExpandedResult |
||
46 | */ |
||
47 | public function setEntry(?ODataEntry $entry): ODataExpandedResult |
||
48 | { |
||
49 | $this->data = $entry; |
||
50 | return $this; |
||
51 | } |
||
52 | |||
53 | /** |
||
54 | * @return ODataFeed|null |
||
55 | */ |
||
56 | public function getFeed(): ?ODataFeed |
||
57 | { |
||
58 | return $this->data instanceof ODataFeed ? $this->data : null; |
||
59 | } |
||
60 | |||
61 | /** |
||
62 | * @param ODataFeed|null $feed |
||
63 | * @return ODataExpandedResult |
||
64 | */ |
||
65 | public function setFeed(?ODataFeed $feed): ODataExpandedResult |
||
69 | } |
||
70 | |||
71 | public function getData(): ODataContainerBase |
||
74 | } |
||
75 | } |
||
76 |