/**
  * @return static
  */
 public function withOrderItems()
 {
     foreach ($this->entity->getOrderItems() as $orderItem) {
         $this->entityDTO->orderItems[] = $this->dtoBuilderFactory->getOrderItemDTOBuilder($orderItem)->build();
     }
     return $this;
 }
Exemple #2
0
 public function addAttachment(Attachment $attachment)
 {
     if (!$this->areAttachmentsEnabled()) {
         throw AttachmentException::notAllowed();
     }
     $attachment->addOrderItem($this);
     $this->attachments->add($attachment);
 }
 private function lockAttachment(Attachment $attachment)
 {
     if (!$attachment->isLocked()) {
         $attachment->setLocked();
         $this->updateAttachment($attachment);
     }
 }