/** * Gets the post * * @param $post_id * * @return mixed|null */ public function GetPost($post_id) { $result = $this->database->Select($post_id); if ($result != null) { return $result; } return null; }
/** * What we do on construct * * @param $post_id */ public function __construct($post_id) { $this->database = DatabasePosts(); /** * If this exists */ if ($this->database->Exists($post_id)) { $this->post_data = $this->database->Select($post_id); } else { /** * Return false if not */ return false; } /** * Return true; */ return true; }