|
@@ -8,6 +8,12 @@ use Doctrine\ORM\EntityManager;
|
|
|
|
|
|
class WorkflowInterfaceListener
|
|
|
{
|
|
|
+ private $container;
|
|
|
+
|
|
|
+ public function __construct($container)
|
|
|
+ {
|
|
|
+ $this->container = $container;
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* @param LifecycleEventArgs $event
|
|
@@ -30,6 +36,11 @@ class WorkflowInterfaceListener
|
|
|
$entity->setCurrentState($workflow->getInitialPlace($entity));
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ $object = $event->getObject();
|
|
|
+ if ($object instanceof \WorkflowBundle\Entity\Workflow) {
|
|
|
+ $object->setContainer($this->container);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
}
|