Mapper::getFilledEntity()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
dl 0
loc 4
rs 10
c 2
b 0
f 0
cc 1
eloc 2
nc 1
nop 2
1
<?php
2
namespace Vsmoraes\DynamoMapper;
3
4
use Vsmoraes\DynamoMapper\Mappings\Factory;
5
6
class Mapper
7
{
8
    /**
9
     * @var Factory
10
     */
11
    private $mappingFactory;
12
13
    public function __construct(Factory $mappingFactory)
14
    {
15
        $this->mappingFactory = $mappingFactory;
16
    }
17
18
    public function getFilledEntity($entity, array $data)
19
    {
20
        return (new EntityMap($entity, $data, $this->mappingFactory))->getMap();
21
    }
22
23
    public function getEntityData($entity)
24
    {
25
        return (new DataMap($entity, $this->mappingFactory))->getMap();
26
    }
27
}
28