public function __construct(Tag $tag, DTOBuilderFactoryInterface $dtoBuilderFactory) { $this->entity = $tag; $this->dtoBuilderFactory = $dtoBuilderFactory; $this->entityDTO = $this->getEntityDTO(); $this->setId(); $this->setTime(); $this->entityDTO->slug = Slug::get($this->entity->getName()); $this->entityDTO->name = $this->entity->getName(); $this->entityDTO->code = $this->entity->getCode(); $this->entityDTO->description = $this->entity->getDescription(); $this->entityDTO->defaultImage = $this->entity->getDefaultImage(); $this->entityDTO->sortOrder = $this->entity->getSortOrder(); $this->entityDTO->isVisible = $this->entity->isVisible(); $this->entityDTO->isActive = $this->entity->isActive(); $this->entityDTO->areAttachmentsEnabled = $this->entity->areAttachmentsEnabled(); }
public function testStringOrNull() { $tag = new Tag(); $tag->setCode(''); $tag->setDescription(''); $tag->setDefaultImage(''); $this->assertSame(null, $tag->getCode()); $this->assertSame(null, $tag->getDescription()); $this->assertSame(null, $tag->getDefaultImage()); }