protected function preBuild() { $this->entityDTO->isPending = $this->entity->isPending(); $this->entityDTO->isProcessing = $this->entity->isProcessing(); $this->entityDTO->isPartiallyShipped = $this->entity->isPartiallyShipped(); $this->entityDTO->isShipped = $this->entity->isShipped(); $this->entityDTO->isComplete = $this->entity->isComplete(); $this->entityDTO->isCanceled = $this->entity->isCanceled(); }
public function getOrderStatusType() { return OrderStatusType::pending(); }
private function setOrderShippedStatus() { if ($this->isFullyShipped()) { $this->setStatus(OrderStatusType::shipped()); } else { $this->setStatus(OrderStatusType::partiallyShipped()); } }
public function handle(SetOrderStatusCommand $command) { $this->orderService->setOrderStatus($command->getOrderId(), OrderStatusType::createById($command->getOrderStatusTypeId())); }
public function testSetOrderStatusLocksAttachments() { $order1 = $this->getPersistedOrderWith2ItemsWithAttachments(); $this->setCountLogger(); $this->orderService->setOrderStatus($order1->getId(), OrderStatusType::canceled()); $this->assertTrue($order1->getStatus()->isCanceled()); $this->assertTrue($order1->getOrderItems()[0]->getAttachments()[0]->isLocked()); $this->assertTrue($order1->getOrderItems()[1]->getAttachments()[0]->isLocked()); $this->assertSame(10, $this->getTotalQueries()); }
public function testCreateByIdThrowsExceptionWhenInvalid() { $this->setExpectedException(InvalidArgumentException::class); OrderStatusType::createById(999); }