| 1 | <?php |
||
| 15 | trait IncludedResourcesContainer |
||
| 16 | { |
||
| 17 | /** |
||
| 18 | * Included resources |
||
| 19 | * |
||
| 20 | * @var ResourceObject[] |
||
| 21 | */ |
||
| 22 | protected $includedResources = []; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * Add included resource |
||
| 26 | * |
||
| 27 | * @param ResourceObject $resource |
||
| 28 | * @return mixed |
||
| 29 | */ |
||
| 30 | 10 | public function addIncludedResource(ResourceObject $resource) |
|
| 34 | |||
| 35 | /** |
||
| 36 | * Get all included resources |
||
| 37 | * |
||
| 38 | * @return ResourceObject[] |
||
| 39 | */ |
||
| 40 | 5 | public function getIncludedResources(): array |
|
| 44 | |||
| 45 | /** |
||
| 46 | * Contains any included resources ? |
||
| 47 | * |
||
| 48 | * @return bool |
||
| 49 | */ |
||
| 50 | 5 | public function hasIncludedResources(): bool |
|
| 54 | |||
| 55 | /** |
||
| 56 | * Cast included resources to an array |
||
| 57 | * |
||
| 58 | * @return array |
||
| 59 | */ |
||
| 60 | 29 | protected function includedResourcesToArray(): array |
|
| 71 | } |