/** * @param string $id * @return bool * @throws StorageException */ public function delete(string $id) : bool { $delete = $this->db->table(self::SCHEMA_TABLE)->find("id=?", [$id])->delete(); if ($delete !== 1 || $this->db->lastQuery->error !== null) { throw StorageException::deleteError(__METHOD__, $this->db->lastQuery->error ?? 'Failed'); } return true; }
/** * @param string $id * @return bool * @throws StorageException */ public function delete(string $id) : bool { $delete = $this->cache->delete("sess_" . $id); if (!$delete) { $error = !empty($this->cache->lastError()) ? $this->cache->lastError() : 'Failed'; throw StorageException::deleteError(__METHOD__, $error); } return true; }