예제 #1
0
 /**
  * Remove related workflow item
  *
  * @param LifecycleEventArgs $args
  */
 public function preRemove(LifecycleEventArgs $args)
 {
     $entity = $args->getEntity();
     if ($this->entityConnector->isWorkflowAware($entity)) {
         $workflowItem = $this->entityConnector->getWorkflowItem($entity);
         if ($workflowItem) {
             $args->getEntityManager()->remove($workflowItem);
         }
     }
 }
예제 #2
0
 /**
  * @expectedException \Oro\Bundle\WorkflowBundle\Exception\WorkflowException
  * @expectedExceptionMessage Can't get property "workflowItem" from entity
  */
 public function testGetWorkflowItemException()
 {
     $this->entityConnector->getWorkflowItem(new \DateTime());
 }