SelfHelp WebApp  v2.0.6
A WebApp to Create WebApps for Studies in Human Sciences
PageDb Class Reference
Inheritance diagram for PageDb:

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)
 

Detailed Description

Class to handle the communication with the DB

Author
moiri

Constructor & Destructor Documentation

◆ __construct()

PageDb::__construct (   $server,
  $dbname,
  $username,
  $password 
)

Open a connection to a mysql database

Parameters
string$serverAddress of the server.
string$dbnameName of the database.
string$usernameThe username of the database user.
string$passwordThe password of the database user.

Member Function Documentation

◆ fetch_accessible_pages()

PageDb::fetch_accessible_pages ( )

Fetch all pages that are not internal.

Return values
arrayThe db result array.
Here is the call graph for this function:

◆ fetch_field_id()

PageDb::fetch_field_id (   $name)

Fetch the id of a field given the nam eof the field

Parameters
string$name
Return values
mixedThe id of the filed or false on failure
Here is the call graph for this function:

◆ fetch_nav_children()

PageDb::fetch_nav_children (   $id)

Fetch all children of a section in the navigation hierarchy.

Parameters
int$idThe section id.
Return values
arrayThe db result array.
Here is the call graph for this function:

◆ fetch_page_fields()

PageDb::fetch_page_fields (   $keyword)

Fetch the content of the page fields from the database given a page keyword.

Parameters
string$keywordThe router keyword of the page.
Return values
arrayThe 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().

Here is the call graph for this function:

◆ 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.

Parameters
int$idThe page id.
Return values
arrayThe db result array.
Here is the call graph for this function:

◆ fetch_page_id_by_keyword()

PageDb::fetch_page_id_by_keyword (   $keyword)

Fetch the page id from the database, given a page keyword.

Parameters
int$keywordThe page keyword.
Return values
intThe id of the page.
Here is the call graph for this function:

◆ fetch_page_info()

PageDb::fetch_page_info (   $keyword)

Fetch the main page information from the database.

Parameters
string$keywordThe keyword identifying the page.
Return values
arrayThe db result array.

Referenced by fetch_page_info_by_id(), and get_link_title().

Here is the call graph for this function:

◆ fetch_page_info_by_id()

PageDb::fetch_page_info_by_id (   $id)

Fetch the main page information from the database, given a page id.

Parameters
int$idThe page id.
Return values
arrayThe db result array.
Here is the call graph for this function:

◆ fetch_page_keyword_by_id()

PageDb::fetch_page_keyword_by_id (   $id)

Fetch the page keyword from the database, given a page id.

Parameters
int$idThe page id.
Return values
stringThe keyword of the page.

Referenced by fetch_page_fields_by_id(), fetch_page_info_by_id(), and fetch_page_sections_by_id().

Here is the call graph for this function:

◆ fetch_page_sections()

PageDb::fetch_page_sections (   $keyword)

Fetch all section ids that are associated to a page.

Parameters
string$keywordThe router keyword of the page.
Return values
arrayThe db result array where each entry has an 'id' field.

Referenced by fetch_page_sections_by_id().

Here is the call graph for this function:

◆ 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.

Parameters
int$idThe page id.
Return values
arrayThe db result array.
Here is the call graph for this function:

◆ fetch_section_children()

PageDb::fetch_section_children (   $id)

Fetch all section ids that are associated to a parent section.

Parameters
int$idThe id of the section.
Return values
arrayThe db result array where each entry has an 'id' field.
Here is the call graph for this function:

◆ fetch_section_fields()

PageDb::fetch_section_fields (   $id,
  $gender = null 
)

Fetch the content of the section fields from the database given a section id.

Parameters
int$idThe id of the section.
in$genderThe name of the gender of which the fields are fetched.
Return values
arrayThe db result array where each entry has the following fields 'name': the name of the section field 'content': the content of the section field
Here is the call graph for this function:

◆ fetch_section_info_by_id()

PageDb::fetch_section_info_by_id (   $id)

Fetch the main section information from the database, given a section id.

Parameters
int$idThe section id.
Return values
arrayThe db result array.
Here is the call graph for this function:

◆ fetch_user_name()

PageDb::fetch_user_name ( )

Get the name of the current user.

Return values
stringThe user name if set, otherwise the user email.

Referenced by fetch_section_fields().

Here is the call graph for this function:

◆ get_link_title()

PageDb::get_link_title (   $keyword)

Get the title of a page by providing a link keyword.

Parameters
string$keywordA link keyword, used to identify router paths.
Return values
stringEither the title of the page or the string "Unknown" if the title could not be found.
Here is the call graph for this function:

◆ get_locale_condition()

PageDb::get_locale_condition ( )

Get the locale condition to fetch the correct language.

Return values
stringA valid mysql condition string.

Referenced by fetch_page_fields(), fetch_page_info(), and fetch_section_fields().


The documentation for this class was generated from the following file: