Example #1
0
 /**
  *
  * {@inheritDoc}
  *
  * @see \Minwork\Operation\Interfaces\OperationInterface::execute()
  */
 public function execute(ObjectOperationInterface $object, array $arguments)
 {
     // If object implements ModelInterface it is possible to be reverted otherwise disable it
     if ($object instanceof ModelInterface) {
         $data = reset($arguments);
         if (is_array($data)) {
             $this->data = $object->getData(array_keys($data));
         } else {
             $this->setCanRevert(false);
         }
     }
     return parent::execute($object, $arguments);
 }
Example #2
0
 public function __construct(EventDispatcherInterface $eventDispatcher = null)
 {
     parent::__construct(self::OPERATION_NAME, true, true, $eventDispatcher);
 }
Example #3
0
 public function __construct($name, $dispatcher)
 {
     parent::__construct($name, true, true, $dispatcher);
 }