| @@ 68-79 (lines=12) @@ | ||
| 65 | return $this->persist($entity); |
|
| 66 | } |
|
| 67 | ||
| 68 | public function insert($entity) |
|
| 69 | { |
|
| 70 | try { |
|
| 71 | $entity = $this->persist($entity); |
|
| 72 | } catch (DBALException $e) { |
|
| 73 | throw $e; |
|
| 74 | } catch (\Exception $e) { |
|
| 75 | throw $e; |
|
| 76 | } |
|
| 77 | ||
| 78 | return $entity; |
|
| 79 | } |
|
| 80 | ||
| 81 | protected function persist($entity) |
|
| 82 | { |
|
| @@ 81-93 (lines=13) @@ | ||
| 78 | return $entity; |
|
| 79 | } |
|
| 80 | ||
| 81 | protected function persist($entity) |
|
| 82 | { |
|
| 83 | try { |
|
| 84 | $this->em->persist($entity); |
|
| 85 | $this->em->flush(); |
|
| 86 | } catch (DBALException $e) { |
|
| 87 | throw $e; |
|
| 88 | } catch (\Exception $e) { |
|
| 89 | throw $e; |
|
| 90 | } |
|
| 91 | ||
| 92 | return $entity; |
|
| 93 | } |
|
| 94 | ||
| 95 | public function remove($entity) |
|
| 96 | { |
|