1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- <?php
- namespace WorkflowBundle\Event;
- use Symfony\Component\EventDispatcher\EventSubscriberInterface;
- use Symfony\Component\Workflow\Event\Event;
- use Symfony\Component\Workflow\Event\GuardEvent;
- use Symfony\Component\DependencyInjection\ContainerInterface;
- # Ayuda:
- # http://blog.eleven-labs.com/en/symfony-workflow-component/
- # https://github.com/lexik/LexikWorkflowBundle
- # https://github.com/fduch/workflow-bundle
- class EventSubscriber implements EventSubscriberInterface
- {
- private $container;
- /**
- * @param ContainerInterface $container
- */
- public function __construct(ContainerInterface $container)
- {
- $this->container = $container;
- }
- public static function getSubscribedEvents()
- {
- return array(
- 'workflow.transition' => array('transition'),
- 'workflow.enter' => array('enter'),
- 'workflow.leave' => array('leave'),
- 'workflow.guard' => array('guard')
- );
- }
- public function transition(Event $event)
- {
-
- }
-
- public function leave(Event $event)
- {
- }
- public function enter(Event $event)
- {
-
- }
-
- public function guard(GuardEvent $event)
- {
- //$event->setBlocked(true);
- }
-
- }
|