autoLastUpdated(); } public function setDefault(string $_fieldType,string $_twigName, string $_content) { $this->setTwigName($_twigName); $this->setFieldType($_fieldType); $this->setContent($_content); } public function getId(): ?int { return $this->id; } public function getTwigName(): ?string { return $this->twigName; } public function setTwigName(string $twigName): self { $this->twigName = $twigName; return $this; } public function getFieldType(): ?string { return $this->fieldType; } public function setFieldType(string $fieldType): self { $this->fieldType = $fieldType; return $this; } public function getContent(): ?string { return $this->content; } public function setContent(string $content): self { $this->content = $content; return $this; } public function getLastUpdated(): ?\DateTimeInterface { return $this->lastUpdated; } /** * @ORM\PreUpdate() */ public function autoLastUpdated(): self { $this->lastUpdated = new \DateTime(); return $this; } /** * @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 setLastUpdated(\DateTimeInterface $lastUpdated): self { $this->lastUpdated = $lastUpdated; return $this; } }