Neos\Flow\Persistence\Doctrine\Mapping\Driver\FlowAnnotationDriver::getMethodCallbacks PHP Method

getMethodCallbacks() protected method

Returns an array of callbacks for lifecycle annotations on the given method.
protected getMethodCallbacks ( ReflectionMethod $method ) : array
$method ReflectionMethod
return array
    protected function getMethodCallbacks(\ReflectionMethod $method)
    {
        $callbacks = [];
        $annotations = $this->reader->getMethodAnnotations($method);
        foreach ($annotations as $annotation) {
            if ($annotation instanceof ORM\PrePersist) {
                $callbacks[] = array($method->name, Events::prePersist);
            }
            if ($annotation instanceof ORM\PostPersist) {
                $callbacks[] = array($method->name, Events::postPersist);
            }
            if ($annotation instanceof ORM\PreUpdate) {
                $callbacks[] = array($method->name, Events::preUpdate);
            }
            if ($annotation instanceof ORM\PostUpdate) {
                $callbacks[] = array($method->name, Events::postUpdate);
            }
            if ($annotation instanceof ORM\PreRemove) {
                $callbacks[] = array($method->name, Events::preRemove);
            }
            if ($annotation instanceof ORM\PostRemove) {
                $callbacks[] = array($method->name, Events::postRemove);
            }
            if ($annotation instanceof ORM\PostLoad) {
                $callbacks[] = array($method->name, Events::postLoad);
            }
            if ($annotation instanceof ORM\PreFlush) {
                $callbacks[] = array($method->name, Events::preFlush);
            }
        }
        return $callbacks;
    }