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(); }