| Total Complexity | 5 |
| Total Lines | 42 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | class HasManyEmbedded implements MapsProperty |
||
| 17 | { |
||
| 18 | private $name; |
||
| 19 | private $collection; |
||
| 20 | private $item; |
||
| 21 | private $key; |
||
| 22 | |||
| 23 | public function __construct( |
||
| 24 | string $name, |
||
| 25 | Hydrates $collection, |
||
| 26 | Hydrates $item, |
||
| 27 | string $key |
||
| 28 | ) { |
||
| 29 | $this->name = $name; |
||
| 30 | $this->collection = $collection; |
||
| 31 | $this->item = $item; |
||
| 32 | $this->key = $key; |
||
| 33 | } |
||
| 34 | |||
| 35 | public static function inProperty( |
||
| 36 | string $property, |
||
| 37 | Hydrates $collection, |
||
| 38 | Hydrates $item, |
||
| 39 | string $key = 'key' |
||
| 40 | ) : MapsProperty |
||
| 41 | { |
||
| 42 | return new static($property, $collection, $item, $key); |
||
| 43 | } |
||
| 44 | |||
| 45 | public function name() : string |
||
| 46 | { |
||
| 47 | return $this->name; |
||
| 48 | } |
||
| 49 | |||
| 50 | /** @inheritdoc @return mixed|object */ |
||
| 51 | public function value(array $data, $owner = null) |
||
| 58 | } |
||
| 59 | } |
||
| 60 |