<?php
declare(strict_types=1);
namespace MLDev\CatalogBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use MLDev\BaseBundle\Annotation\Uploadable;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Table(name="MLDev_Product_Composition")
* @ORM\Entity()
*/
class Composition
{
/**
* @ORM\Id
* @ORM\Column(name="id", type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\Column(name="name", type="string", nullable=true)
*/
private $name;
/**
* @ORM\Column(name="caption", type="string", nullable=true)
*/
private $caption;
/**
* @ORM\Column(name="description", type="text", nullable=true)
*/
private $description;
/**
* @ORM\Column(name="priority", type="integer", nullable=true)
*/
private $priority = 100;
/**
* @ORM\Column(type="string", name="image", nullable=true)
*
* @Uploadable(directoryAlias="products")
* @Assert\File(mimeTypes={"image/jpeg", "image/jpg", "image/png", "image/svg"})
*/
private $image = null;
public function __toString()
{
return $this->getName();
}
public function getId()
{
return $this->id;
}
public function setId($id): self
{
$this->id = $id;
return $this;
}
public function getName()
{
return $this->name;
}
public function setName($name): self
{
$this->name = $name;
return $this;
}
public function getCaption()
{
return $this->caption;
}
public function setCaption($caption): self
{
$this->caption = $caption;
return $this;
}
public function getDescription()
{
return $this->description;
}
public function setDescription($description): self
{
$this->description = $description;
return $this;
}
public function getPriority(): int
{
return $this->priority;
}
public function setPriority(int $priority): self
{
$this->priority = $priority;
return $this;
}
public function getImage()
{
return $this->image;
}
public function setImage($image): self
{
$this->image = $image;
return $this;
}
}