@@ 42-48 (lines=7) @@ | ||
39 | * |
|
40 | * @throws ParseException |
|
41 | */ |
|
42 | public function getData(ModelInterface $model, $mapType = 'dto') |
|
43 | { |
|
44 | $class = get_class($model); |
|
45 | $fn = \Closure::bind($this->closuresFn->getToDataFn(), $model, $class); |
|
46 | $map = $this->mapsManager->getMap($class, $mapType); |
|
47 | return $fn($map, $this->typeConverter); |
|
48 | } |
|
49 | ||
50 | /** |
|
51 | * @param array $data |
|
@@ 57-63 (lines=7) @@ | ||
54 | * |
|
55 | * @throws ParseException |
|
56 | */ |
|
57 | public function fillModel(array $data, ModelInterface $model, $mapType = 'dto') |
|
58 | { |
|
59 | $class = get_class($model); |
|
60 | $fn = \Closure::bind($this->closuresFn->getFillFn(), $model, $class); |
|
61 | $map = $this->mapsManager->getMap($class, $mapType); |
|
62 | $fn($data, $map, $this->typeConverter); |
|
63 | } |
|
64 | ||
65 | /** |
|
66 | * @param string $class |