public function beforeSave($event) { $campos = explode(',', $this->campos); foreach ($campos as $campo) { if (!(isset($this->getOwner()->{trim($campo) . '_alt'}) && $this->getOwner()->{trim($campo) . '_alt'} != '' && $this->getOwner()->{trim($campo) . '_bdd'} != $this->getOwner()->{trim($campo) . '_alt'})) { $this->getOwner()->{trim($campo)} = $this->getOwner()->{trim($campo) . '_bdd'}; } if (isset($this->getOwner()->{trim($campo) . '_time'})) { $aux = DateTools::parseAmPmTo24h($this->getOwner()->{trim($campo) . '_time_bdd'}); $this->getOwner()->{trim($campo)} .= ' ' . $aux; } } return true; }