Class OnpubAuthors

Description

Manage authors in an Onpub database.

Located in /OnpubAuthors.php (line 13)


	
			
Variable Summary
Method Summary
OnpubAuthors __construct (PDO $pdo, [bool $enableTransactions = TRUE])
int count ()
OnpubAuthor get (int $ID)
int getID (OnpubAuthor $author)
mixed insert (mixed $authors)
array select ([OnpubQueryOptions $queryOptions = NULL])
int update (OnpubAuthor $author)
Variables
bool $enableTransactions (line 19)
  • access: public
Methods
Constructor __construct (line 42)

Connect to an Onpub database.

All the methods in this class which query the database use the database connection provided by the PDO object required by this constructor. Currently, Onpub only supports MySQL as a database for storing content. Therefore, when constructing the PDO object, only the PDO_MYSQL driver is supported as a PDO data source.

All the methods in this class require the Onpub schema to be installed in the PDO-connected database. The OnpubDatabase class contains methods to manage the Onpub schema. The Onpub schema can also be installed by clicking the "Install the schema" link once logged in to the Onpub web interface. The schema generally only has to be installed once per database.

OnpubAuthors __construct (PDO $pdo, [bool $enableTransactions = TRUE])
count (line 52)
  • access: public
int count ()
get (line 75)
  • return: An OnpubAuthor object. NULL if the author does not exist in the database.
  • access: public
OnpubAuthor get (int $ID)
  • int $ID: ID of the author to get.
getID (line 109)
  • return: The ID of the author. NULL if the author does not exist in the database.
  • access: public
int getID (OnpubAuthor $author)
  • OnpubAuthor $author: Author whose ID you want to get.
insert (line 203)
  • return: The ID(s) of the new author(s). An int will be returned if a single author was inserted. An array of ints will be returned if multiple authors were inserted.
  • throws: PDOException if there's a database error.
  • access: public
mixed insert (mixed $authors)
  • mixed $authors: A single OnpubAuthor object or an array of OnpubAuthor objects (to insert multiple authors at a time).
select (line 131)
  • return: An array of OnpubAuthor objects.
  • access: public
array select ([OnpubQueryOptions $queryOptions = NULL])
update (line 293)
  • return: 1 if the author was updated. 0 if the author does not exist in the database.
  • access: public
int update (OnpubAuthor $author)

Documentation generated on Fri, 08 Feb 2013 04:02:19 -0500 by phpDocumentor 1.4.4