|
SelfHelp WebApp
v2.0.6
A WebApp to Create WebApps for Studies in Human Sciences
|
Public Member Functions | |
| __construct ($server, $dbname, $username, $password) | |
| get_link_title ($keyword) | |
| get_locale_condition () | |
| fetch_accessible_pages () | |
| fetch_field_id ($name) | |
| fetch_page_id_by_keyword ($keyword) | |
| fetch_page_keyword_by_id ($id) | |
| fetch_page_info_by_id ($id) | |
| fetch_section_info_by_id ($id) | |
| fetch_page_info ($keyword) | |
| fetch_nav_children ($id) | |
| fetch_page_sections_by_id ($id) | |
| fetch_page_sections ($keyword) | |
| fetch_page_fields_by_id ($id) | |
| fetch_page_fields ($keyword) | |
| fetch_section_children ($id) | |
| fetch_section_fields ($id, $gender=null) | |
| fetch_user_name () | |
Public Member Functions inherited from BaseDb | |
| __construct ($server, $dbname, $username, $password, $names="utf8") | |
| get_dbh () | |
| execute_db ($sql) | |
| execute_update_db ($sql, $arguments=array()) | |
| query_db ($sql, $arguments=array(), $fetch_style=PDO::FETCH_ASSOC) | |
| query_db_first ($sql, $arguments=array(), $fetch_style=PDO::FETCH_ASSOC) | |
| remove_by_fk ($table, $fk, $id) | |
| remove_by_ids ($table, $ids) | |
| set_db_locale ($locale) | |
| select_table ($table) | |
| select_by_fk ($table, $fk, $id) | |
| select_by_fks ($table, $fks) | |
| select_by_uid ($table, $id) | |
| select_by_uid_join ($table, $id) | |
| insert ($table, $entries, $update_entries=array()) | |
| insert_mult ($table, $cols, $data) | |
| update_by_ids ($table, $entries, $ids) | |
Class to handle the communication with the DB
| PageDb::__construct | ( | $server, | |
| $dbname, | |||
| $username, | |||
| $password | |||
| ) |
Open a connection to a mysql database
| string | $server | Address of the server. |
| string | $dbname | Name of the database. |
| string | $username | The username of the database user. |
| string | $password | The password of the database user. |
| PageDb::fetch_accessible_pages | ( | ) |
Fetch all pages that are not internal.
| array | The db result array. |
| PageDb::fetch_field_id | ( | $name | ) |
Fetch the id of a field given the nam eof the field
| string | $name |
| mixed | The id of the filed or false on failure |
| PageDb::fetch_nav_children | ( | $id | ) |
Fetch all children of a section in the navigation hierarchy.
| int | $id | The section id. |
| array | The db result array. |
| PageDb::fetch_page_fields | ( | $keyword | ) |
Fetch the content of the page fields from the database given a page keyword.
| string | $keyword | The router keyword of the page. |
| array | The db result array where each entry has the following fields 'name': the name of the page field 'content': the content of the page field |
Referenced by fetch_page_fields_by_id().
| PageDb::fetch_page_fields_by_id | ( | $id | ) |
Fetch the content of the page fields from the database given a page id.
| int | $id | The page id. |
| array | The db result array. |
| PageDb::fetch_page_id_by_keyword | ( | $keyword | ) |
Fetch the page id from the database, given a page keyword.
| int | $keyword | The page keyword. |
| int | The id of the page. |
| PageDb::fetch_page_info | ( | $keyword | ) |
Fetch the main page information from the database.
| string | $keyword | The keyword identifying the page. |
| array | The db result array. |
Referenced by fetch_page_info_by_id(), and get_link_title().
| PageDb::fetch_page_info_by_id | ( | $id | ) |
Fetch the main page information from the database, given a page id.
| int | $id | The page id. |
| array | The db result array. |
| PageDb::fetch_page_keyword_by_id | ( | $id | ) |
Fetch the page keyword from the database, given a page id.
| int | $id | The page id. |
| string | The keyword of the page. |
Referenced by fetch_page_fields_by_id(), fetch_page_info_by_id(), and fetch_page_sections_by_id().
| PageDb::fetch_page_sections | ( | $keyword | ) |
Fetch all section ids that are associated to a page.
| string | $keyword | The router keyword of the page. |
| array | The db result array where each entry has an 'id' field. |
Referenced by fetch_page_sections_by_id().
| PageDb::fetch_page_sections_by_id | ( | $id | ) |
Fetch all section ids that are associated to a page, given a page id.
| int | $id | The page id. |
| array | The db result array. |
| PageDb::fetch_section_children | ( | $id | ) |
Fetch all section ids that are associated to a parent section.
| int | $id | The id of the section. |
| array | The db result array where each entry has an 'id' field. |
| PageDb::fetch_section_fields | ( | $id, | |
$gender = null |
|||
| ) |
Fetch the content of the section fields from the database given a section id.
| int | $id | The id of the section. |
| in | $gender | The name of the gender of which the fields are fetched. |
| array | The db result array where each entry has the following fields 'name': the name of the section field 'content': the content of the section field |
| PageDb::fetch_section_info_by_id | ( | $id | ) |
Fetch the main section information from the database, given a section id.
| int | $id | The section id. |
| array | The db result array. |
| PageDb::fetch_user_name | ( | ) |
Get the name of the current user.
| string | The user name if set, otherwise the user email. |
Referenced by fetch_section_fields().
| PageDb::get_link_title | ( | $keyword | ) |
Get the title of a page by providing a link keyword.
| string | $keyword | A link keyword, used to identify router paths. |
| string | Either the title of the page or the string "Unknown" if the title could not be found. |
| PageDb::get_locale_condition | ( | ) |
Get the locale condition to fetch the correct language.
| string | A valid mysql condition string. |
Referenced by fetch_page_fields(), fetch_page_info(), and fetch_section_fields().