Conditions | 4 |
Paths | 4 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
36 | return new $class($attributes, $this->orm->getCastingManager()); |
||
37 | } |
||
38 | |||
39 | public function extract(EntityInterface $entity) |
||
40 | { |
||
41 | $data = Arr::renameKeys( |
||
42 | $entity->getArrayCopy(), |
||
43 | array_flip($this->mapper->getColumnAttributeMap()) |
||
44 | ); |
||
45 | $data = $this->orm |
||
46 | ->getCastingManager() |
||
47 | ->castArrayForDb($data, $this->mapper->getCasts()); |
||
48 | |||
49 | return Arr::only($data, $this->mapper->getColumns()); |
||
50 | } |
||
51 | } |
||
52 |