Advertisement
gadjov

PostModel

Jul 16th, 2016
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.59 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4. class PostModel extends BaseModel
  5. {
  6.     public function getAll() : array
  7.     {
  8.         $statement = self::$db->query(
  9.             "SELECT * FROM posts ORDER BY date DESC");
  10.         return $statement->fetch_all(MYSQLI_ASSOC);
  11.     }
  12.  
  13.     public function getById(int $id)
  14.     {
  15.  
  16.     }
  17.  
  18.     public function create(string $title, string $content, int $user_id) : bool
  19.     {
  20.  
  21.     }
  22.  
  23.     public function edit(string $id, string $title, string $content,
  24.         string $date, int $user_id) : bool
  25.     {
  26.  
  27.     }
  28.  
  29.     public function delete(int $id) : bool
  30.     {
  31.  
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement