|
@@ -71,12 +71,16 @@ class WorkflowApplyCommand extends ContainerAwareCommand
|
|
|
|
|
|
$entityId = $input->getOption('id');
|
|
|
if (!class_exists($entityClass)) {
|
|
|
- throw new \Exception("Class '$entityClass' not found");
|
|
|
+ $output->writeln("Class '$entityClass' not found");
|
|
|
+
|
|
|
+ return;
|
|
|
}
|
|
|
|
|
|
$entity = $entity_manager->getRepository($entityClass)->find($entityId);
|
|
|
if (!$entity) {
|
|
|
- throw new \Exception("Entity $entityClass with id $entityId not found");
|
|
|
+ $output->writeln("Entity $entityClass with id $entityId not found");
|
|
|
+
|
|
|
+ return;
|
|
|
}
|
|
|
|
|
|
// Si no se pasa workflow como parametro se busca según el workflow que tenga
|
|
@@ -96,7 +100,6 @@ class WorkflowApplyCommand extends ContainerAwareCommand
|
|
|
}, $wf->getEnabledTransitions($entity));
|
|
|
|
|
|
if (!in_array($transition, $transitions)) {
|
|
|
- // throw new \Exception ("Can't apply transition '$transition', only allowed transitions for this entity are '". implode("','", $transitions). "'");
|
|
|
$output->writeln("Can't apply transition '$transition', only allowed transitions for this entity are '". implode("','", $transitions). "'");
|
|
|
|
|
|
return;
|