Class OnpubWSMaps

Description

Manage website-section maps in an Onpub database.

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

  • Add a single section to multiple websites.
  • Add multiple sections to a single website.
  • Specify the order of sections in a website.

Located in /OnpubWSMaps.php (line 21)


	
			
Variable Summary
Method Summary
OnpubWSMaps __construct (PDO $pdo, [bool $enableTransactions = TRUE])
int delete (int $websiteID, int $sectionID)
int getID (OnpubWSMap $wsmap)
mixed insert (mixed $wsmaps)
array select ([OnpubQueryOptions $queryOptions = NULL], [ $websiteID = NULL], [ $sectionID = 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.

OnpubWSMaps __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 $websiteID, int $sectionID)
  • int $websiteID: Delete the map(s) with websiteID.
  • int $sectionID: Delete the map(s) with sectionID.
getID (line 93)
  • return: The ID of the map. NULL if the map does not exist in the database.
  • access: public
int getID (OnpubWSMap $wsmap)
  • OnpubWSMap $wsmap: Map whose ID you want to get.
insert (line 199)
  • 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 $wsmaps)
  • mixed $wsmaps: A single OnpubWSMap object or an array of OnpubWSMap objects (to insert multiple maps at a time).
select (line 117)
  • return: An array of OnpubWSMap objects.
  • access: public
array select ([OnpubQueryOptions $queryOptions = NULL], [ $websiteID = NULL], [ $sectionID = NULL])

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