public function onBeforeWrite() { parent::onBeforeWrite(); if ($this->Name && !$this->Label) { $this->Label = $this->Name; } elseif ($this->Label && !$this->Name) { $this->Name = $this->Label; } }