Conditions | 3 |
Paths | 3 |
Total Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
15 | 4 | public function buildCollection(array $data, $entityType = null) |
|
16 | { |
||
17 | 4 | $collection = new Collection; |
|
18 | |||
19 | 4 | foreach ($data as $row) { |
|
20 | 3 | $entity = (is_null($entityType)) ? $this->getEntityType() : $entityType; |
|
21 | 3 | $entity = new $entity; |
|
22 | |||
23 | 3 | $collection->addEntity( |
|
24 | 3 | $entity->hydrate($row) |
|
25 | 3 | ); |
|
26 | 4 | } |
|
27 | |||
28 | 4 | return $collection; |
|
29 | } |
||
30 | |||
38 |