OPiQuotations  v.02.00.00 — October 26, 2015
 All Classes Namespaces Files Functions Variables Pages
Public Member Functions | Protected Attributes | List of all members
OPiQuotations\OPiQuotations Class Reference

Class to get OPiQuotation and informations from the databse. More...

Public Member Functions

 __construct ()
 Connect to the database. See the Db class.
 list_authors ()
 Return a associative table id => array(name, number of use) of elements of the table author.
 list_nations ()
 Return a associative table id => array(name, number of use) of elements of the table nation.
 list_subjects ()
 list_works ()
 Return a associative table id => array(name, number of use) of elements of the table work.
 nb ($is_maxim=null)
 If $is_maxim === null then return the numbers of quotations/maxims, if $is_maxim === false then return the numbers of quotations, if $is_maxim === true then return the numbers of maxims.
 quotation_by_id ($id)
 Return the unique quotation/maxim of id $id.
 quotations_all ()
 Return the complete list of quotations/maxims.
 quotations_all_marked ()
 Return the list of quotations/maxims that are marked.
 quotations_by_author ($author)
 Return the list of quotations that are writed by author $author.
 quotations_by_ids ($ids)
 Return the list of quotations/maxims of id among $ids.
 quotations_by_nation ($nation)
 Return the list of maxims of nationality $nation.
 quotations_by_random ($nb=1, $label=null)
 Return a list of $nb different quotations choose at random.
 quotations_by_subject ($subject)
 Return the list of quotations/maxims of subject $subject.
 quotations_by_text ($text)
 Return the list of quotations/maxims that contains the text $text.
 quotations_by_translation ($translation)
 Return the list of quotations/maxims with a translation that contains the text $translation.
 quotations_by_work ($work)
 Return the list of quotations/maxims that are writed in work $work.

Protected Attributes

 $db
 Link to the database.

Detailed Description

Class to get OPiQuotation and informations from the databse.

Definition at line 178 of file OPiQuotations.inc.

Constructor & Destructor Documentation

OPiQuotations\OPiQuotations::__construct ( )

Connect to the database. See the Db class.

Definition at line 184 of file OPiQuotations.inc.

Member Function Documentation

OPiQuotations\OPiQuotations::list_authors ( )

Return a associative table id => array(name, number of use) of elements of the table author.

Returns
array[array]

Definition at line 199 of file OPiQuotations.inc.

OPiQuotations\OPiQuotations::list_nations ( )

Return a associative table id => array(name, number of use) of elements of the table nation.

Returns
array[array]

Definition at line 211 of file OPiQuotations.inc.

OPiQuotations\OPiQuotations::list_subjects ( )

Return a associative table id => array(name, number of use) of elements of the table subject.

Returns
array[array]

Definition at line 222 of file OPiQuotations.inc.

OPiQuotations\OPiQuotations::list_works ( )

Return a associative table id => array(name, number of use) of elements of the table work.

Returns
array[array]

Definition at line 234 of file OPiQuotations.inc.

OPiQuotations\OPiQuotations::nb (   $is_maxim = null)

If $is_maxim === null then return the numbers of quotations/maxims, if $is_maxim === false then return the numbers of quotations, if $is_maxim === true then return the numbers of maxims.

Parameters
null | bool$is_maxim
Returns
int >= 0

Definition at line 249 of file OPiQuotations.inc.

OPiQuotations\OPiQuotations::quotation_by_id (   $id)

Return the unique quotation/maxim of id $id.

If this id doesn't exist then return null.

Parameters
int$id
Returns
null|OPiQuotation

Definition at line 269 of file OPiQuotations.inc.

References $quots.

OPiQuotations\OPiQuotations::quotations_all ( )

Return the complete list of quotations/maxims.

Returns
OPiQuotation[]

Definition at line 292 of file OPiQuotations.inc.

OPiQuotations\OPiQuotations::quotations_all_marked ( )

Return the list of quotations/maxims that are marked.

Returns
OPiQuotation[]

Definition at line 304 of file OPiQuotations.inc.

OPiQuotations\OPiQuotations::quotations_by_author (   $author)

Return the list of quotations that are writed by author $author.

Parameters
string$author
Returns
OPiQuotation[]

Definition at line 318 of file OPiQuotations.inc.

OPiQuotations\OPiQuotations::quotations_by_ids (   $ids)

Return the list of quotations/maxims of id among $ids.

Parameters
int[]$ids (each int > 0)
Returns
OPiQuotation[]

Definition at line 336 of file OPiQuotations.inc.

OPiQuotations\OPiQuotations::quotations_by_nation (   $nation)

Return the list of maxims of nationality $nation.

Parameters
string$nation
Returns
OPiQuotation[]

Definition at line 364 of file OPiQuotations.inc.

OPiQuotations\OPiQuotations::quotations_by_random (   $nb = 1,
  $label = null 
)

Return a list of $nb different quotations choose at random.

If $label !== null then choose quotations not already chosen with this label and set the chosen quotations with this $label.

Parameters
int$nb(must be >= 0)
null | string$label
Returns
OPiQuotation[]

Definition at line 387 of file OPiQuotations.inc.

References $quots.

OPiQuotations\OPiQuotations::quotations_by_subject (   $subject)

Return the list of quotations/maxims of subject $subject.

Parameters
string$subject
Returns
OPiQuotation[]

Definition at line 428 of file OPiQuotations.inc.

OPiQuotations\OPiQuotations::quotations_by_text (   $text)

Return the list of quotations/maxims that contains the text $text.

Parameters
string$text
Returns
OPiQuotation[]

Definition at line 446 of file OPiQuotations.inc.

References $text.

OPiQuotations\OPiQuotations::quotations_by_translation (   $translation)

Return the list of quotations/maxims with a translation that contains the text $translation.

Parameters
string$translation
Returns
OPiQuotation[]

Definition at line 464 of file OPiQuotations.inc.

OPiQuotations\OPiQuotations::quotations_by_work (   $work)

Return the list of quotations/maxims that are writed in work $work.

Parameters
string$work
Returns
OPiQuotation[]

Definition at line 482 of file OPiQuotations.inc.

Member Data Documentation

Db OPiQuotations\OPiQuotations::$db
protected

Link to the database.

Definition at line 497 of file OPiQuotations.inc.


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