protected function beforeSave() { $this->date = MyFormat::InvoiceDateToDbDate($this->date); return parent::beforeSave(); }