updatesOrderCurrentStep = $updatesOrderCurrentStep; $this->unityConfig = Config::get('unity'); $this->createsManyOrderStep = $createsManyOrderStep; $this->updateOrderStepProcessors = $updateOrderStepProcessors; $this->getContractObligationsProcessor = $getContractObligationsProcessor; } public function execute(Order $order){ $obligations = $this->getContractObligationsProcessor->execute(); foreach($obligations as $step){ $orderSteps[] = new OrderStepsObject( $order->id, 1, $step->name, true, $step->sequence, 0, 0, null ); } $this->createsManyOrderStep->execute($order, $orderSteps); $this->updatesOrderCurrentStep->execute($order->id, OrderSteps::PACKING); $this->updateOrderStepProcessors->execute(OrderSteps::PROCESSING); } }