/** * Saves the properties to the database. * * This performs an intelligent insert/update, and reloads the * properties with fresh data from the table on success. * * @param \VuFind\Db\Row\User|bool $user Logged-in user (false if none) * * @return mixed The primary key value(s), as an associative array if the * key is compound, or a scalar if the key is single-column. * @throws ListPermissionException * @throws MissingFieldException */ public function save($user = false) { if (!$this->editAllowed($user)) { throw new ListPermissionException('list_access_denied'); } if (empty($this->title)) { throw new MissingFieldException('list_edit_name_required'); } parent::save(); $this->rememberLastUsed(); return $this->id; }