| Conditions | 3 |
| Paths | 3 |
| Total Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | public function getFromAgreement(Agreement $agreement) |
||
| 11 | { |
||
| 12 | $em = $this->getEntityManager(); |
||
| 13 | $activities = $agreement->getActivities(); |
||
| 14 | |||
| 15 | $outcomes = new ArrayCollection(); |
||
| 16 | |||
| 17 | /** @var Activity $activity */ |
||
| 18 | foreach ($activities as $activity) { |
||
| 19 | if (false === $outcomes->contains($activity->getLearningOutcome())) { |
||
| 20 | $outcomes->add($activity->getLearningOutcome()); |
||
| 21 | } |
||
| 22 | } |
||
| 23 | return $em->createQuery('SELECT l FROM AppBundle:LearningOutcome l WHERE l.id IN (:outcomes) ORDER BY l.code') |
||
| 24 | ->setParameter('outcomes', $outcomes) |
||
| 25 | ->getResult(); |
||
| 26 | } |
||
| 27 | |||
| 43 |