public function __construct(Image $image, DTOBuilderFactoryInterface $dtoBuilderFactory) { $this->entity = $image; $this->dtoBuilderFactory = $dtoBuilderFactory; $this->entityDTO = new ImageDTO(); $this->setId(); $this->setTime(); $this->entityDTO->path = $this->entity->getPath(); $this->entityDTO->width = $this->entity->getWidth(); $this->entityDTO->height = $this->entity->getHeight(); $this->entityDTO->sortOrder = $this->entity->getSortOrder(); }
public function addImage(Image $image) { if ($this->images->isEmpty()) { $this->setDefaultImage($image->getPath()); } $image->setTag($this); $this->images->add($image); }
public function testCreateDefaults() { $image = new Image(); $this->assertSame(null, $image->getPath()); $this->assertSame(null, $image->getWidth()); $this->assertSame(null, $image->getHeight()); $this->assertSame(0, $image->getSortOrder()); $this->assertSame(null, $image->getProduct()); $this->assertSame(null, $image->getTag()); }