protected function getMethodCallbacks(\ReflectionMethod $method)
    {
        $callbacks = [];
        $annotations = $this->reader->getMethodAnnotations($method);

        foreach ($annotations as $annotation) {
            if ($annotation instanceof ORM\PrePersist) {
                $callbacks[] = [$method->name, Events::prePersist];
            }

            if ($annotation instanceof ORM\PostPersist) {
                $callbacks[] = [$method->name, Events::postPersist];
            }

            if ($annotation instanceof ORM\PreUpdate) {
                $callbacks[] = [$method->name, Events::preUpdate];
            }

            if ($annotation instanceof ORM\PostUpdate) {
                $callbacks[] = [$method->name, Events::postUpdate];
            }

            if ($annotation instanceof ORM\PreRemove) {
                $callbacks[] = [$method->name, Events::preRemove];
            }

            if ($annotation instanceof ORM\PostRemove) {
                $callbacks[] = [$method->name, Events::postRemove];
            }

            if ($annotation instanceof ORM\PostLoad) {
                $callbacks[] = [$method->name, Events::postLoad];
            }

            if ($annotation instanceof ORM\PreFlush) {
                $callbacks[] = [$method->name, Events::preFlush];
            }
        }

        return $callbacks;
    }
protected function getMethodCallbacks(\ReflectionMethod $method)
    {
        $callbacks = [];
        $annotations = $this->reader->getMethodAnnotations($method);

        foreach ($annotations as $annotation) {
            if ($annotation instanceof ORM\PrePersist) {
                $callbacks[] = [$method->name, Events::prePersist];
            }

            if ($annotation instanceof ORM\PostPersist) {
                $callbacks[] = [$method->name, Events::postPersist];
            }

            if ($annotation instanceof ORM\PreUpdate) {
                $callbacks[] = [$method->name, Events::preUpdate];
            }

            if ($annotation instanceof ORM\PostUpdate) {
                $callbacks[] = [$method->name, Events::postUpdate];
            }

            if ($annotation instanceof ORM\PreRemove) {
                $callbacks[] = [$method->name, Events::preRemove];
            }

            if ($annotation instanceof ORM\PostRemove) {
                $callbacks[] = [$method->name, Events::postRemove];
            }

            if ($annotation instanceof ORM\PostLoad) {
                $callbacks[] = [$method->name, Events::postLoad];
            }

            if ($annotation instanceof ORM\PreFlush) {
                $callbacks[] = [$method->name, Events::preFlush];
            }
        }

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

@param \ReflectionMethod $method
@return array
Returns an array of callbacks for lifecycle annotations on the given method .