Total Complexity | 4 |
Total Lines | 28 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
11 | trait HasMediaPropertiesTrait |
||
12 | { |
||
13 | /** |
||
14 | * @param $collection |
||
15 | * @return \ByTIC\MediaLibrary\Models\MediaProperties\MediaProperty|\Nip\Records\AbstractModels\Record |
||
16 | */ |
||
17 | public function mediaProperties($collection) |
||
18 | { |
||
19 | $propertiesRecord = MediaModels::properties()->for($this, $collection); |
||
|
|||
20 | if (!is_object($propertiesRecord)) { |
||
21 | $propertiesRecord = $this->generateMediaProperties($collection); |
||
22 | } |
||
23 | |||
24 | return $propertiesRecord; |
||
25 | } |
||
26 | |||
27 | /** |
||
28 | * @param $collection |
||
29 | * @return \ByTIC\MediaLibrary\Models\MediaProperties\MediaProperty |
||
30 | */ |
||
31 | protected function generateMediaProperties($collection) |
||
39 | } |
||
40 | } |