| @@ 437-439 (lines=3) @@ | ||
| 434 | $args = array(&$data); |
|
| 435 | $metadata->invokeLifecycleCallbacks(Events::preLoad, $document, $args); |
|
| 436 | } |
|
| 437 | if ($this->evm->hasListeners(Events::preLoad)) { |
|
| 438 | $this->evm->dispatchEvent(Events::preLoad, new PreLoadEventArgs($document, $this->dm, $data)); |
|
| 439 | } |
|
| 440 | ||
| 441 | // alsoLoadMethods may transform the document before hydration |
|
| 442 | if ( ! empty($metadata->alsoLoadMethods)) { |
|
| @@ 463-465 (lines=3) @@ | ||
| 460 | if ( ! empty($metadata->lifecycleCallbacks[Events::postLoad])) { |
|
| 461 | $metadata->invokeLifecycleCallbacks(Events::postLoad, $document); |
|
| 462 | } |
|
| 463 | if ($this->evm->hasListeners(Events::postLoad)) { |
|
| 464 | $this->evm->dispatchEvent(Events::postLoad, new LifecycleEventArgs($document, $this->dm)); |
|
| 465 | } |
|
| 466 | ||
| 467 | return $data; |
|
| 468 | } |
|
| @@ 183-186 (lines=4) @@ | ||
| 180 | ||
| 181 | $class->setParentClasses($nonSuperclassParents); |
|
| 182 | ||
| 183 | if ($this->evm->hasListeners(Events::loadClassMetadata)) { |
|
| 184 | $eventArgs = new \Doctrine\ODM\MongoDB\Event\LoadClassMetadataEventArgs($class, $this->dm); |
|
| 185 | $this->evm->dispatchEvent(Events::loadClassMetadata, $eventArgs); |
|
| 186 | } |
|
| 187 | } |
|
| 188 | ||
| 189 | /** |
|
| @@ 1032-1034 (lines=3) @@ | ||
| 1029 | if ( ! empty($class->lifecycleCallbacks[Events::prePersist])) { |
|
| 1030 | $class->invokeLifecycleCallbacks(Events::prePersist, $document); |
|
| 1031 | } |
|
| 1032 | if ($this->evm->hasListeners(Events::prePersist)) { |
|
| 1033 | $this->evm->dispatchEvent(Events::prePersist, new LifecycleEventArgs($document, $this->dm)); |
|
| 1034 | } |
|
| 1035 | ||
| 1036 | $upsert = false; |
|
| 1037 | if ($class->identifier) { |
|
| @@ 1942-1944 (lines=3) @@ | ||
| 1939 | if ( ! empty($class->lifecycleCallbacks[Events::preRemove])) { |
|
| 1940 | $class->invokeLifecycleCallbacks(Events::preRemove, $document); |
|
| 1941 | } |
|
| 1942 | if ($this->evm->hasListeners(Events::preRemove)) { |
|
| 1943 | $this->evm->dispatchEvent(Events::preRemove, new LifecycleEventArgs($document, $this->dm)); |
|
| 1944 | } |
|
| 1945 | $this->scheduleForDelete($document); |
|
| 1946 | break; |
|
| 1947 | case self::STATE_DETACHED: |
|
| @@ 2512-2514 (lines=3) @@ | ||
| 2509 | } |
|
| 2510 | } |
|
| 2511 | ||
| 2512 | if ($this->evm->hasListeners(Events::onClear)) { |
|
| 2513 | $this->evm->dispatchEvent(Events::onClear, new Event\OnClearEventArgs($this->dm, $documentName)); |
|
| 2514 | } |
|
| 2515 | } |
|
| 2516 | ||
| 2517 | /** |
|