| @@ 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 | /** |
|
| @@ 436-438 (lines=3) @@ | ||
| 433 | $args = array(new PreLoadEventArgs($document, $this->dm, $data)); |
|
| 434 | $metadata->invokeLifecycleCallbacks(Events::preLoad, $document, $args); |
|
| 435 | } |
|
| 436 | if ($this->evm->hasListeners(Events::preLoad)) { |
|
| 437 | $this->evm->dispatchEvent(Events::preLoad, new PreLoadEventArgs($document, $this->dm, $data)); |
|
| 438 | } |
|
| 439 | ||
| 440 | // alsoLoadMethods may transform the document before hydration |
|
| 441 | if ( ! empty($metadata->alsoLoadMethods)) { |
|
| @@ 462-464 (lines=3) @@ | ||
| 459 | if ( ! empty($metadata->lifecycleCallbacks[Events::postLoad])) { |
|
| 460 | $metadata->invokeLifecycleCallbacks(Events::postLoad, $document, array(new LifecycleEventArgs($document, $this->dm))); |
|
| 461 | } |
|
| 462 | if ($this->evm->hasListeners(Events::postLoad)) { |
|
| 463 | $this->evm->dispatchEvent(Events::postLoad, new LifecycleEventArgs($document, $this->dm)); |
|
| 464 | } |
|
| 465 | ||
| 466 | return $data; |
|
| 467 | } |
|
| @@ 1038-1040 (lines=3) @@ | ||
| 1035 | if ( ! empty($class->lifecycleCallbacks[Events::prePersist])) { |
|
| 1036 | $class->invokeLifecycleCallbacks(Events::prePersist, $document, array(new LifecycleEventArgs($document, $this->dm))); |
|
| 1037 | } |
|
| 1038 | if ($this->evm->hasListeners(Events::prePersist)) { |
|
| 1039 | $this->evm->dispatchEvent(Events::prePersist, new LifecycleEventArgs($document, $this->dm)); |
|
| 1040 | } |
|
| 1041 | ||
| 1042 | $upsert = false; |
|
| 1043 | if ($class->identifier) { |
|
| @@ 1937-1939 (lines=3) @@ | ||
| 1934 | if ( ! empty($class->lifecycleCallbacks[Events::preRemove])) { |
|
| 1935 | $class->invokeLifecycleCallbacks(Events::preRemove, $document, array(new LifecycleEventArgs($document, $this->dm))); |
|
| 1936 | } |
|
| 1937 | if ($this->evm->hasListeners(Events::preRemove)) { |
|
| 1938 | $this->evm->dispatchEvent(Events::preRemove, new LifecycleEventArgs($document, $this->dm)); |
|
| 1939 | } |
|
| 1940 | $this->scheduleForDelete($document); |
|
| 1941 | break; |
|
| 1942 | case self::STATE_DETACHED: |
|
| @@ 2507-2509 (lines=3) @@ | ||
| 2504 | } |
|
| 2505 | } |
|
| 2506 | ||
| 2507 | if ($this->evm->hasListeners(Events::onClear)) { |
|
| 2508 | $this->evm->dispatchEvent(Events::onClear, new Event\OnClearEventArgs($this->dm, $documentName)); |
|
| 2509 | } |
|
| 2510 | } |
|
| 2511 | ||
| 2512 | /** |
|