/** * @param WorkflowDefinition $definition * @return array */ protected function getDataAsArray(WorkflowDefinition $definition) { $entitiesData = array(); foreach ($definition->getWorkflowDefinitionEntities() as $entity) { $entitiesData[] = array('class' => $entity->getClassName()); } return array('name' => $definition->getName(), 'label' => $definition->getLabel(), 'enabled' => $definition->isEnabled(), 'start_step' => $definition->getStartStep(), 'configuration' => $definition->getConfiguration(), 'entities' => $entitiesData); }
/** * @param WorkflowDefinition $definition * @return $this */ public function import(WorkflowDefinition $definition) { $this->setName($definition->getName())->setType($definition->getType())->setLabel($definition->getLabel())->setEnabled($definition->isEnabled())->setConfiguration($definition->getConfiguration())->setStartStep($definition->getStartStep())->setWorkflowDefinitionEntities($definition->getWorkflowDefinitionEntities()); return $this; }