/** * @ORM\PrePersist */ public function updateParentFields() { if ($this->object->getLocale() == $this->locale) { $method = 'set' . ucfirst($this->field); if (method_exists($this->object, $method)) { $this->object->{$method}($this->getContent()); } } }