URL\" ORDER BY Date DESC" ); } function totalViewCount() : int { return Table::_get_all( 'Webpages', 'Database\Webpage', "WHERE URL = \"$this->URL\"", "SUM(Visits) as WID" )[0]->WID; } function previousPageId() : int { $foundId = Table::_get_all( "Webpages", "Database\Webpage", "WHERE URL = \"$this->URL\" AND Date < \"$this->Date\" ORDER BY Date DESC LIMIT 1", "WID" ); if (count($foundId) > 0) { return $foundId[0]->WID; } return 0; } function nextPageId() : int { $foundId = Table::_get_all( "Webpages", "Database\Webpage", "WHERE URL = \"$this->URL\" AND Date > \"$this->Date\" ORDER BY Date ASC LIMIT 1", "WID" ); if (count($foundId) > 0) { return $foundId[0]->WID; } return 0; } function incrementVisits() { Table::_update( 'Webpages', "Visits = \"" . ($this->Visits + 1) . "\"", "WID = \"{$this->WID}\"" ); } function delete() { Table::_delete( 'Webpages', "WID = \"$this->WID\"" ); } }