Class OnpubAuthors

Description

Manage authors in an Onpub database.

Located in /OnpubAuthors.php (line 14)


	
			
Variable Summary
Method Summary
OnpubAuthors __construct ( $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 20)
  • access: public
Methods
Constructor __construct (line 43)

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, [bool $enableTransactions = TRUE])
count (line 53)
  • access: public
int count ()
get (line 76)
  • 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 197)
  • 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 281)
  • 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 Sat, 20 Sep 2008 19:13:14 -0400 by phpDocumentor 1.4.2