public function delete() { $sql = 'DELETE FROM ' . static::getTable() . ' WHERE articleId = :articleId'; $db = new Database(); $result = $db->execute($sql, [':articleId' => $this->articleId]); if ($result == false) { throw new MyException('E404'); } else { return $result; } }
public function setSess($sess) { $sql = 'UPDATE ' . static::getTable() . ' SET userSess = :userSess WHERE userId = :userId'; $db = new Database(); return $db->execute($sql, [':userSess' => $sess, ':userId' => $this->userId]); }