Conditions | 3 |
Paths | 3 |
Total Lines | 25 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
20 | public function findByIds(array $listId = []) |
||
21 | { |
||
22 | $countListId = count($listId); |
||
23 | if (0 === $countListId) { |
||
24 | return []; |
||
25 | } |
||
26 | |||
27 | $dql = sprintf( |
||
28 | 'SELECT s FROM %s s WHERE s.id IN (:stepIds)', |
||
29 | $this->_entityName |
||
30 | ); |
||
31 | |||
32 | $query = $this->_em->createQuery($dql); |
||
33 | $query->setParameter('stepIds', $listId); |
||
34 | |||
35 | /** @var AbstractStep[] $steps */ |
||
36 | $steps = $query->getResult(); |
||
37 | |||
38 | if ($countListId !== count($steps)) { |
||
39 | $errMsg = 'error search step'; |
||
40 | throw new Exception\RuntimeException($errMsg); |
||
41 | } |
||
42 | |||
43 | return $steps; |
||
44 | } |
||
45 | } |
||
46 |