/** * @return $this */ public function save() { if (!empty($this->id)) { $this->update(); $event = new \Civi\Core\DAO\Event\PostUpdate($this); \Civi\Core\Container::singleton()->get('dispatcher')->dispatch("DAO::post-update", $event); } else { $this->insert(); $event = new \Civi\Core\DAO\Event\PostUpdate($this); \Civi\Core\Container::singleton()->get('dispatcher')->dispatch("DAO::post-insert", $event); } $this->free(); CRM_Utils_Hook::postSave($this); return $this; }
/** * Save DAO object. * * @param bool $hook * * @return $this */ public function save($hook = TRUE) { if (!empty($this->id)) { $this->update(); if ($hook) { $event = new \Civi\Core\DAO\Event\PostUpdate($this); \Civi::service('dispatcher')->dispatch("DAO::post-update", $event); } } else { $this->insert(); if ($hook) { $event = new \Civi\Core\DAO\Event\PostUpdate($this); \Civi::service('dispatcher')->dispatch("DAO::post-insert", $event); } } $this->free(); if ($hook) { CRM_Utils_Hook::postSave($this); } return $this; }
/** * @return $this */ function save() { if (!empty($this->id)) { $this->update(); } else { $this->insert(); } $this->free(); CRM_Utils_Hook::postSave($this); return $this; }