| 1 | <?php |
||
| 9 | class PropertyMetadata extends BasePropertyMetadata implements MergeableInterface |
||
| 10 | { |
||
| 11 | 62 | public function __construct($class, $name) |
|
| 12 | { |
||
| 13 | try { |
||
| 14 | 62 | parent::__construct($class, $name); |
|
| 15 | 24 | } catch (\ReflectionException $e) { |
|
|
1 ignored issue
–
show
|
|||
| 16 | /* Ignore missing property definition as they might just be overridden and therefore only exist in the |
||
| 17 | parent class. They will be accessible after merging. */ |
||
| 18 | } |
||
| 19 | 62 | } |
|
| 20 | |||
| 21 | /** |
||
| 22 | * @var string|null |
||
| 23 | */ |
||
| 24 | private $type; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @var bool |
||
| 28 | */ |
||
| 29 | private $puttable; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * @var bool |
||
| 33 | */ |
||
| 34 | private $excluded; |
||
| 35 | |||
| 36 | /** |
||
| 37 | * @var bool |
||
| 38 | */ |
||
| 39 | private $postable; |
||
| 40 | |||
| 41 | /** |
||
| 42 | * @var bool |
||
| 43 | */ |
||
| 44 | private $includable; |
||
| 45 | |||
| 46 | /** |
||
| 47 | * @var string[]|null |
||
| 48 | */ |
||
| 49 | private $includablePaths; |
||
| 50 | |||
| 51 | /** |
||
| 52 | * @var bool |
||
| 53 | */ |
||
| 54 | private $subResource; |
||
| 55 | |||
| 56 | /** |
||
| 57 | * @var Method[]|null |
||
| 58 | */ |
||
| 59 | private $methods; |
||
| 60 | |||
| 61 | /** |
||
| 62 | * @var bool |
||
| 63 | */ |
||
| 64 | private $association; |
||
| 65 | |||
| 66 | /** |
||
| 67 | * @var bool |
||
| 68 | */ |
||
| 69 | private $collection; |
||
| 70 | |||
| 71 | /** |
||
| 72 | * @var bool |
||
| 73 | */ |
||
| 74 | private $virtual; |
||
| 75 | |||
| 76 | /** |
||
| 77 | * @var string|null |
||
| 78 | */ |
||
| 79 | private $subResourcePath; |
||
| 80 | |||
| 81 | 2 | public function isPuttable(): bool |
|
| 82 | { |
||
| 83 | 2 | return $this->getBool($this->puttable, false); |
|
| 84 | } |
||
| 85 | |||
| 86 | 34 | public function setPuttable(bool $puttable) |
|
| 90 | |||
| 91 | 2 | public function isPostable(): bool |
|
| 92 | { |
||
| 95 | |||
| 96 | 34 | public function setPostable(bool $postable) |
|
| 100 | |||
| 101 | 44 | public function isIncludable(): bool |
|
| 105 | |||
| 106 | public function isVirtual(): bool |
||
| 110 | |||
| 111 | 22 | public function setVirtual(bool $virtual) |
|
| 115 | |||
| 116 | 60 | public function setIncludable(bool $includable) |
|
| 120 | |||
| 121 | 8 | public function isSubResource(): bool |
|
| 125 | |||
| 126 | 58 | public function setSubResource(bool $subResource) |
|
| 130 | |||
| 131 | 8 | public function getSubResourcePath(): ?string |
|
| 135 | |||
| 136 | public function setSubResourcePath(string $subResourcePath) |
||
| 140 | |||
| 141 | 44 | public function isExcluded(): bool |
|
| 145 | |||
| 146 | 54 | public function setExcluded(bool $excluded) |
|
| 150 | |||
| 151 | /** |
||
| 152 | * @return null|\string[] |
||
| 153 | */ |
||
| 154 | 42 | public function getIncludablePaths(): ?array |
|
| 158 | |||
| 159 | /** |
||
| 160 | * @param null|\string[] $includablePaths |
||
| 161 | */ |
||
| 162 | 60 | public function setIncludablePaths(?array $includablePaths) |
|
| 166 | |||
| 167 | 44 | public function isAssociation(): bool |
|
| 171 | |||
| 172 | 58 | public function setAssociation(bool $association) |
|
| 176 | |||
| 177 | 28 | public function isCollection(): bool |
|
| 181 | |||
| 182 | 58 | public function setCollection(bool $collection) |
|
| 186 | |||
| 187 | 46 | public function getType(): ?string |
|
| 191 | |||
| 192 | 62 | public function setType(?string $type) |
|
| 196 | |||
| 197 | /** |
||
| 198 | * @param Method[] $methods |
||
| 199 | */ |
||
| 200 | 58 | public function setMethods(array $methods) |
|
| 204 | |||
| 205 | 6 | public function merge(MergeableInterface $other) |
|
| 227 | |||
| 228 | 48 | protected function getBool(?bool $value, bool $default) |
|
| 236 | |||
| 237 | 6 | private function mergeField($thisValue, $otherValue) |
|
| 245 | |||
| 246 | 36 | public function getMethod(string $methodName): ?Method |
|
| 260 | } |
||
| 261 |