|
@@ -64,13 +64,20 @@ class WorkflowDefaultCommand extends ContainerAwareCommand
|
|
|
}
|
|
|
|
|
|
if (!is_null($workflow) && $input->getOption('all')) {
|
|
|
+ // actualizo las onus que no tengan currentState.
|
|
|
+ // por ej si fueron importadas
|
|
|
$qb = $em->getRepository($class)->createQueryBuilder($class);
|
|
|
$result = $qb->update($class, 'o')
|
|
|
- ->set('o.workflow', ':workflow')
|
|
|
- ->setParameter('workflow', $workflow)
|
|
|
- ->getQuery()
|
|
|
- ->getResult()
|
|
|
- ;
|
|
|
+ ->set('o.currentState', ':currentState')
|
|
|
+ ->setParameter('currentState', 'active')
|
|
|
+ ->where('o.currentState IS NULL')
|
|
|
+ ->getQuery()->getResult();
|
|
|
+
|
|
|
+ $qb = $em->getRepository($class)->createQueryBuilder($class);
|
|
|
+ $result = $qb->update($class, 'o')
|
|
|
+ ->set('o.workflow', ':workflow')
|
|
|
+ ->setParameter('workflow', $workflow)
|
|
|
+ ->getQuery()->getResult();
|
|
|
|
|
|
$output->writeln("<info>Se ejecutó la actualización de entidates</info> {$class}");
|
|
|
$output->writeln("<info>Result:</info> {$result}");
|