Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class PostModel extends BaseModel
- {
- public function getAll() : array
- {
- $statement = self::$db->query(
- "SELECT * FROM posts ORDER BY date DESC");
- return $statement->fetch_all(MYSQLI_ASSOC);
- }
- public function getById(int $id)
- {
- }
- public function create(string $title, string $content, int $user_id) : bool
- {
- }
- public function edit(string $id, string $title, string $content,
- string $date, int $user_id) : bool
- {
- }
- public function delete(int $id) : bool
- {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement