| Conditions | 3 |
| Paths | 4 |
| Total Lines | 27 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 21 | public function __construct( |
||
| 22 | DbDriverInterface $dbDriver, |
||
| 23 | UserDefinition $userTable = null |
||
| 24 | ) { |
||
| 25 | if (empty($userTable)) { |
||
| 26 | $userTable = new UserDefinition(); |
||
| 27 | } |
||
| 28 | |||
| 29 | $userMapper = new Mapper( |
||
| 30 | $userTable->model(), |
||
| 31 | $userTable->table(), |
||
| 32 | $userTable->getUserid() |
||
| 33 | ); |
||
| 34 | |||
| 35 | $propertyDefinition = $userTable->toArray(); |
||
| 36 | |||
| 37 | foreach ($propertyDefinition as $property => $map) { |
||
| 38 | $userMapper->addFieldMap( |
||
| 39 | $property, |
||
| 40 | $map, |
||
| 41 | $userTable->getClosureForUpdate($property), |
||
| 42 | $userTable->getClosureForSelect($property) |
||
| 43 | ); |
||
| 44 | } |
||
| 45 | |||
| 46 | $this->repository = new Repository($dbDriver, $userMapper); |
||
| 47 | } |
||
| 48 | } |
||
| 49 |