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;
}