/** * @param $stepsData * @return Step[] */ public function createSteps($stepsData) { $steps = array(); foreach ($stepsData as $entityData) { if ($entityData['action']) { $stepEntity = new Step(); $stepEntity->setAction($entityData['action']); $stepEntity->setEstimatedTime($entityData['estimatedTime']); $this->stepManager->persistStep($stepEntity); $steps[] = $stepEntity; } } $this->stepManager->saveChanges(); return $steps; }
/** * @param Step $step */ function __construct(Step $step) { $this->id = $step->getId(); $this->action = $step->getAction(); $this->estimatedTime = $step->getEstimatedTime(); }