<?phpnamespace App\Entity;use App\Utils\Slugger;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\ORM\Mapping as ORM;use Gedmo\Mapping\Annotation as Gedmo;use Gedmo\Sluggable\Util\Urlizer;/** * @ORM\Entity(repositoryClass="App\Repository\OptionRepository") * * @ORM\Table(name="option_item") * * @ORM\HasLifecycleCallbacks */class Option{ /** * @ORM\Id * * @ORM\Column(type="bigint") * * @ORM\GeneratedValue(strategy="AUTO") */ protected $id; /** * @ORM\Column(type="string", length=1024) */ protected $codeSlug; /** * @ORM\Column(type="string", length=1024) * * @Gedmo\Translatable */ protected $name; /** * @ORM\Column(type="integer") */ protected $weight; /** * Locale. * * @Gedmo\Locale */ protected $locale; public function __construct(/** * @ORM\Column(type="string", length=1024) */ protected $code) { $this->weight = 0; } /** * Set slug. * * @ORM\PrePersist() * * @ORM\PreUpdate() */ public function initSlugs(): void { $this->codeSlug = Urlizer::urlize($this->code); } /** * Get id. * * @return id */ public function getId() { return $this->id; } /** * Get Code. * * @return code */ public function getCode() { return $this->code; } /** * Set code. * * @param code the value to set */ public function setCode($code): void { $this->code = $code; } /** * Get CodeSlug. * * @return codeSlug */ public function getCodeSlug() { return $this->codeSlug; } /** * Set codeSlug. * * @param codeSlug the value to set */ public function setCodeSlug($codeSlug): void { $this->codeSlug = $codeSlug; } /** * Get name. * * @return name */ public function getName() { return $this->name; } /** * Set name. * * @param name the value to set */ public function setName($name): void { $this->name = $name; } /** * Get weight. * * @return weight */ public function getWeight() { return $this->weight; } /** * Set weight. * * @param weight the value to set */ public function setWeight($weight): void { $this->weight = $weight; } /** * Get locale. * * @return locale */ public function getLocale() { return $this->locale; } /** * Set locale. * * @param locale the value to set */ public function setLocale($locale): void { $this->locale = $locale; } public function setTranslatableLocale($locale): void { $this->locale = $locale; }}