Class OnpubAAMaps

Description

Manage article-author maps in an Onpub database.

This class contains the methods to manage the data contained in an OnpubAAMaps table. An OnpubAAMaps table maps article IDs to author IDs. This allows Onpub to do the following without any duplication of article/author data:

  • Use the same author for multiple articles.
  • A single article can have multiple authors.
  • Specify the order of an article's authors.

Located in /OnpubAAMaps.php (line 21)


	
			
Variable Summary
Method Summary
OnpubAAMaps __construct (PDO $pdo, [bool $enableTransactions = TRUE])
int delete (int $articleID, int $authorID)
int getID (OnpubAAMap $aamap)
mixed insert (mixed $aamaps)
array select ([OnpubQueryOptions $queryOptions = NULL])
Variables
bool $enableTransactions (line 27)
  • access: public
Methods
Constructor __construct (line 50)

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.

OnpubAAMaps __construct (PDO $pdo, [bool $enableTransactions = TRUE])
delete (line 62)
  • return: The number of maps deleted, 0 if no maps were deleted.
  • access: public
int delete (int $articleID, int $authorID)
  • int $articleID: Delete the map(s) with articleID.
  • int $authorID: Delete the map(s) with authorID.
getID (line 161)
  • return: The ID of the map. NULL if the map does not exist in the database.
  • access: public
int getID (OnpubAAMap $aamap)
  • OnpubAAMap $aamap: Map whose ID you want to get.
insert (line 186)
  • return: The ID(s) of the new map(s). An int will be returned if a single map was inserted. An array of ints will be returned if multiple maps were inserted.
  • throws: PDOException if there's a database error.
  • access: public
mixed insert (mixed $aamaps)
  • mixed $aamaps: A single OnpubAAMap object or an array of OnpubAAMap objects (to insert multiple maps at a time).
select (line 93)
  • return: An array of OnpubAAMap objects.
  • access: public
array select ([OnpubQueryOptions $queryOptions = NULL])

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