lang = $lang; $this->slug = $slug; $this->mappedEntity = $mappedEntity; $this->mappedEntity_id = $mappedEntity_id; $this->updateDhUpdate(); } /** * @return int|null */ public function getId(): ?int { return $this->id; } /** * @return mixed */ public function getLang() { return $this->lang; } /** * @param mixed $lang * @return AGridSlugElement */ public function setLang($lang): AGridSlugElement { $this->lang = $lang; return $this; } /** * @return mixed */ public function getSlug() { return $this->slug; } /** * @param mixed $slug * @return AGridSlugElement */ public function setSlug($slug): AGridSlugElement { $this->slug = $slug; return $this; } /** * @return mixed */ public function getMappedEntity() { return $this->mappedEntity; } /** * @param mixed $mappedEntity * @return AGridSlugElement */ public function setMappedEntity($mappedEntity): AGridSlugElement { $this->mappedEntity = $mappedEntity; return $this; } /** * @return mixed */ public function getMappedEntityId() { return $this->mappedEntity_id; } /** * @param mixed $mappedEntity_id * @return AGridSlugElement */ public function setMappedEntityId($mappedEntity_id): AGridSlugElement { $this->mappedEntity_id = $mappedEntity_id; return $this; } /** * @return DateTime */ public function getDhUpdate(): DateTime { return $this->dhUpdate; } /** * @ORM\PreUpdate() */ public function updateDhUpdate(): void { $this->dhUpdate = new DateTime(); } /** * @param array $_element * * Parcourire l'objet * On recupére le nom du setter * Si le setter existe, on le hydrate */ public function hydrate(array $_element){ foreach ($_element as $key => $value){ $method = 'set' . ucfirst($key); if (method_exists($this, $method)) $this->$method($value); } } public function setDhUpdate(?\DateTimeInterface $dhUpdate): self { $this->dhUpdate = $dhUpdate; return $this; } }