예제 #1
0
 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;
     }
 }
예제 #2
0
 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]);
 }