| @@ 256-265 (lines=10) @@ | ||
| 253 | * @param LifecycleEventArgs $args |
|
| 254 | * @return object |
|
| 255 | */ |
|
| 256 | protected function getObjectFromLifeCycleArgs(LifecycleEventArgs $args) |
|
| 257 | { |
|
| 258 | $rc = new \ReflectionClass('Doctrine\Common\Persistence\Event\LifecycleEventArgs'); |
|
| 259 | ||
| 260 | if ($rc->hasMethod('getObject')) { |
|
| 261 | return $args->getObject(); |
|
| 262 | } else { |
|
| 263 | return $args->getEntity(); |
|
| 264 | } |
|
| 265 | } |
|
| 266 | ||
| 267 | /** |
|
| 268 | * Avoid calling deprecated methods if possible. |
|
| @@ 273-282 (lines=10) @@ | ||
| 270 | * @param LifecycleEventArgs $args |
|
| 271 | * @return \Doctrine\Common\Persistence\ObjectManager|\Doctrine\ORM\EntityManager |
|
| 272 | */ |
|
| 273 | protected function getOmFromLifeCycleArgs(LifecycleEventArgs $args) |
|
| 274 | { |
|
| 275 | $rc = new \ReflectionClass('Doctrine\Common\Persistence\Event\LifecycleEventArgs'); |
|
| 276 | ||
| 277 | if ($rc->hasMethod('getObjectManager')) { |
|
| 278 | return $args->getObjectManager(); |
|
| 279 | } else { |
|
| 280 | return $args->getEntityManager(); |
|
| 281 | } |
|
| 282 | } |
|
| 283 | } |
|
| 284 | ||