/** * @param array $options * @return $this */ public function save(array $options = []) { if (parent::save($options)) { return $this; } throw new FailedToSaveModel(); }
public function save(array $options = array()) { if (stripos($this->first_name, " ") !== false && empty($this->middle_name)) { $p = explode(" ", $this->first_name); if (count($p) == 2) { $this->first_name = $p[0]; $this->middle_name = $p[1]; } else { $this->first_name = array_shift($p); $this->middle_name = implode(" ", $p); } } if (strlen($this->middle_name) == 1) { $this->middle_name = $this->middle_name . '.'; } $this->setAliases(); $this->setDivision(); $this->setPhoto(); parent::save(); }