| Conditions | 2 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 14 | public function persist(AbstractEntity $entity) |
||
| 15 | { |
||
| 16 | $entityClass = get_class($entity); |
||
| 17 | if ($this->getEntityName() !== $entity) { |
||
| 18 | $msg = sprintf('Entity "%s" does not belong to this repository', $entityClass); |
||
| 19 | throw new \InvalidArgumentException($msg); |
||
| 20 | } |
||
| 21 | |||
| 22 | $this->_em->persist($entity); |
||
| 23 | $this->_em->flush($entity); |
||
| 24 | } |
||
| 25 | } |
||
| 26 |