get_db()->prepare(" SELECT id, project, type, url FROM project_url WHERE id = :id "); $statement->bindValue(':id', $id, PDO::PARAM_INT); $statement->execute(); $r_url = $statement->fetch(PDO::FETCH_ASSOC); if ($r_url !== false){ $this->id = $r_url["id"]; $this->project = $r_url["project"]; $this->type = new Project_Url_Type($r_url["type"]); $this->url = $r_url["url"]; } else{ Log::warn("Project URL with id '$id' doesn't exist"); } } /** * Retrieves the URL identifier * * @return int URL ID. */ public function get_id(){ return $this->id; } /** * Retrieves the project identifier * * @return int Project ID. */ public function get_project(){ return $this->project; } /** * Retrieves the url type. * * @return Project_Url_Type URL type. */ public function get_type(){ return $this->type; } /** * Retrieves the URL * * @return string The URL. */ public function get_url(){ return $this->url; } }