|
@@ -101,8 +101,19 @@ class EventSubscriber implements EventSubscriberInterface
|
|
$objectClass = (string) get_class($object);
|
|
$objectClass = (string) get_class($object);
|
|
$logger->info("EVENT {$eventName}:{$eventReference} => {$objectClass }_id_{$object->getId()}");
|
|
$logger->info("EVENT {$eventName}:{$eventReference} => {$objectClass }_id_{$object->getId()}");
|
|
|
|
|
|
- $actions = $em->getRepository("WorkflowBundle:Action")
|
|
|
|
- ->findAllByEventAndWorkflowName($eventName, $object->getWorkflowName(), $eventReference, $objectClass);
|
|
|
|
|
|
+ $criteria = array("workflowName" => $event->getWorkflowName(), "eventReference" => $eventReference
|
|
|
|
+ );
|
|
|
|
+ $actions = $em->getRepository("WorkflowBundle:Action")->findBy($criteria);
|
|
|
|
+
|
|
|
|
+ $new_actions = array();
|
|
|
|
+ foreach($actions as $action){
|
|
|
|
+
|
|
|
|
+ if(in_array($eventName, $action->getEvent()) AND is_a($object, $action->getObjectClass())){
|
|
|
|
+ $new_actions[] = $action;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ $actions = $new_actions;
|
|
|
|
+ $logger->info("EVENT Found ". count($actions) . " actions to apply", $criteria);
|
|
|
|
|
|
return $actions;
|
|
return $actions;
|
|
}
|
|
}
|
|
@@ -131,4 +142,4 @@ class EventSubscriber implements EventSubscriberInterface
|
|
// file_put_contents("/var/flowdat/ftth/out.log", $string);
|
|
// file_put_contents("/var/flowdat/ftth/out.log", $string);
|
|
}
|
|
}
|
|
|
|
|
|
-}
|
|
|
|
|
|
+}
|