public function __construct(Attachment $attachment, DTOBuilderFactoryInterface $dtoBuilderFactory)
 {
     $this->entity = $attachment;
     $this->dtoBuilderFactory = $dtoBuilderFactory;
     $this->entityDTO = new AttachmentDTO();
     $this->setId();
     $this->setTime();
     $this->entityDTO->isVisible = $this->entity->isVisible();
     $this->entityDTO->isLocked = $this->entity->isLocked();
     $this->entityDTO->uri = $this->entity->getUri();
 }
Exemplo n.º 2
0
 private function lockAttachment(Attachment $attachment)
 {
     if (!$attachment->isLocked()) {
         $attachment->setLocked();
         $this->updateAttachment($attachment);
     }
 }