Open Monograph Press  1.1
 All Classes Namespaces Functions Variables Groups Pages
CategoryDAO Class Reference
Inheritance diagram for CategoryDAO:
DAO

Public Member Functions

 _fromRow ($row)
 
 CategoryDAO ()
 
 categoryExistsByPath ($path)
 
 deleteById ($categoryId, $pressId=null)
 
 deleteByPressId ($pressId)
 
 deleteObject ($category)
 
 getById ($categoryId, $pressId=null, $parentId=null)
 
 getByParentId ($parentId, $pressId=null, $rangeInfo=null)
 
 getByPath ($path, $pressId)
 
 getByPressId ($pressId, $rangeInfo=null)
 
 getByTitle ($categoryTitle, $pressId, $locale=null)
 
 getCountByPressId ($pressId)
 
 getInsertId ()
 
 getLocaleFieldNames ()
 
 insertObject ($category)
 
 newDataObject ()
 
 updateLocaleFields ($category)
 
 updateObject ($category)
 
- Public Member Functions inherited from DAO
 concat ()
 
 convertFromDB ($value, $type)
 
 convertToDB ($value, &$type)
 
 DAO ($dataSource=null, $callHooks=true)
 
 dateFromDB ($d)
 
 datetimeFromDB ($dt)
 
 datetimeToDB ($dt)
 
 dateToDB ($d)
 
 flushCache ()
 
 formatDateToDB ($date, $defaultNumWeeks=null, $acceptPastDate=true)
 
 getAffectedRows ()
 
getDataSource ()
 
 getDirectionMapping ($direction)
 
 getDriver ()
 
 getType ($value)
 
 replace ($table, $arrFields, $keyCols)
 
retrieve ($sql, $params=false, $callHooks=true)
 
retrieveCached ($sql, $params=false, $secsToCache=3600, $callHooks=true)
 
retrieveLimit ($sql, $params=false, $numRows=false, $offset=false, $callHooks=true)
 
retrieveRange ($sql, $params=false, $dbResultRange=null, $callHooks=true)
 
 setCacheDir ()
 
 setDataSource (&$dataSource)
 
 update ($sql, $params=false, $callHooks=true, $dieOnError=true)
 
 updateDataObjectSettings ($tableName, &$dataObject, $idArray)
 

Additional Inherited Members

- Static Public Member Functions inherited from DAO
static getDataChangedEvent ($elementId=null, $parentElementId=null)
 
- Public Attributes inherited from DAO
 $_dataSource
 
- Protected Member Functions inherited from DAO
 _getInsertId ($table= '', $id= '')
 

Detailed Description

Operations for retrieving and modifying Category objects.

See Also
Category

Definition at line 20 of file CategoryDAO.inc.php.

Member Function Documentation

CategoryDAO::_fromRow (   $row)

Internal function to return an Category object from a row.

Parameters
$rowarray
Returns
Category

Definition at line 138 of file CategoryDAO.inc.php.

References HookRegistry\call(), and newDataObject().

Referenced by getById(), getByPath(), and getByTitle().

CategoryDAO::CategoryDAO ( )

Constructor

Definition at line 24 of file CategoryDAO.inc.php.

CategoryDAO::categoryExistsByPath (   $path)

Check if a category exists with a specified path.

Parameters
$paththe path for the category
Returns
boolean

Definition at line 115 of file CategoryDAO.inc.php.

References DAO\retrieve().

CategoryDAO::deleteById (   $categoryId,
  $pressId = null 
)

Delete an category by ID.

Parameters
$categoryIdint
$pressIdint optional

Definition at line 239 of file CategoryDAO.inc.php.

References DAO\getAffectedRows(), and DAO\update().

Referenced by deleteObject().

CategoryDAO::deleteByPressId (   $pressId)

Delete category by press ID NOTE: This does not delete dependent entries. It is intended to be called only when deleting a press.

Parameters
$pressIdint

Definition at line 272 of file CategoryDAO.inc.php.

References deleteObject(), and getByPressId().

CategoryDAO::deleteObject (   $category)

Delete an category.

Parameters
$categoryCategory

Definition at line 227 of file CategoryDAO.inc.php.

References deleteById().

Referenced by deleteByPressId().

CategoryDAO::getById (   $categoryId,
  $pressId = null,
  $parentId = null 
)

Retrieve an category by ID.

Parameters
$categoryIdint
$pressIdint optional
$parentIdint optional
Returns
Category

Definition at line 35 of file CategoryDAO.inc.php.

References _fromRow(), and DAO\retrieve().

CategoryDAO::getByParentId (   $parentId,
  $pressId = null,
  $rangeInfo = null 
)

Retrieve all categories for a parent category.

Returns
DAOResultFactory containing Category ordered by sequence

Definition at line 318 of file CategoryDAO.inc.php.

References DAO\retrieveRange().

CategoryDAO::getByPath (   $path,
  $pressId 
)

Retrieve a category by path.

Parameters
$pathstring
$pressIdint
Returns
Category

Definition at line 63 of file CategoryDAO.inc.php.

References _fromRow(), and DAO\retrieve().

CategoryDAO::getByPressId (   $pressId,
  $rangeInfo = null 
)

Retrieve all categories for a press.

Returns
DAOResultFactory containing Category ordered by sequence

Definition at line 283 of file CategoryDAO.inc.php.

References DAO\retrieveRange().

Referenced by deleteByPressId().

CategoryDAO::getByTitle (   $categoryTitle,
  $pressId,
  $locale = null 
)

Retrieve an category by title.

Parameters
$categoryTitlestring
$pressIdint
$localestring optional
Returns
Category

Definition at line 85 of file CategoryDAO.inc.php.

References _fromRow(), and DAO\retrieve().

CategoryDAO::getCountByPressId (   $pressId)

Retrieve the number of categories for a press.

Returns
DAOResultFactory containing Category ordered by sequence

Definition at line 301 of file CategoryDAO.inc.php.

References DAO\retrieve().

CategoryDAO::getInsertId ( )

Get the ID of the last inserted category.

Returns
int

Definition at line 336 of file CategoryDAO.inc.php.

References DAO\_getInsertId().

Referenced by insertObject().

CategoryDAO::getLocaleFieldNames ( )

Get the list of fields for which data can be localized.

Returns
array

Definition at line 158 of file CategoryDAO.inc.php.

CategoryDAO::insertObject (   $category)

Insert a new category.

Parameters
$categoryCategory
Returns
int ID of the inserted category.

Definition at line 180 of file CategoryDAO.inc.php.

References getInsertId(), DAO\update(), and updateLocaleFields().

CategoryDAO::newDataObject ( )

Construct a new data object corresponding to this DAO.

Returns
Category

Definition at line 129 of file CategoryDAO.inc.php.

Referenced by _fromRow().

CategoryDAO::updateLocaleFields (   $category)

Update the localized fields for this table

Parameters
$categoryobject

Definition at line 166 of file CategoryDAO.inc.php.

References DAO\updateDataObjectSettings().

Referenced by insertObject(), and updateObject().

CategoryDAO::updateObject (   $category)

Update an existing category.

Parameters
$categoryCategory

Definition at line 203 of file CategoryDAO.inc.php.

References DAO\update(), and updateLocaleFields().


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