Open Journal Systems  3.3.0
GenreDAO Class Reference
Inheritance diagram for GenreDAO:
DAO

Public Member Functions

 _fromRow ($row)
 
 deleteByContextId ($contextId)
 
 deleteById ($genreId)
 
 deleteObject ($genre)
 
 deleteSettingsByLocale ($locale)
 
 getByContextId ($contextId, $rangeInfo=null)
 
 getByDependenceAndContextId ($dependentFilesOnly, $contextId, $rangeInfo=null)
 
 getById ($genreId, $contextId=null)
 
 getByKey ($key, $contextId=null)
 
 getBySupplementaryAndContextId ($supplementaryFilesOnly, $contextId, $rangeInfo=null)
 
 getDefaultKeys ()
 
 getEnabledByContextId ($contextId, $rangeInfo=null)
 
 getInsertId ()
 
 getLocaleFieldNames ()
 
 getPrimaryByContextId ($contextId, $rangeInfo=null)
 
 insertObject ($genre)
 
 installDefaults ($contextId, $locales)
 
 keyExists ($key, $contextId, $genreId=null)
 
 newDataObject ()
 
 updateLocaleFields ($genre)
 
 updateObject ($genre)
 
- Public Member Functions inherited from DAO
 __construct ($dataSource=null, $callHooks=true)
 
 concat ()
 
 convertFromDB ($value, $type)
 
 convertToDB ($value, &$type)
 
 dateFromDB ($d)
 
 datetimeFromDB ($dt)
 
 datetimeToDB ($dt)
 
 dateToDB ($d)
 
 flushCache ()
 
 formatDateToDB ($date, $defaultNumWeeks=null, $acceptPastDate=true)
 
 getAdditionalFieldNames ()
 
 getAffectedRows ()
 
 getDataObjectSettings ($tableName, $idFieldName, $idFieldValue, $dataObject)
 
 getDataSource ()
 
 getDirectionMapping ($direction)
 
 getDriver ()
 
 getType ($value)
 
 handleError ($dataSource, $sql)
 
 nullOrInt ($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, $content='')
 
- Data Fields inherited from DAO
 $_dataSource
 
- Protected Member Functions inherited from DAO
 _getInsertId ($table='', $id='')
 

Detailed Description

Operations for retrieving and modifying Genre objects.

See also
Genre

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

Member Function Documentation

◆ _fromRow()

GenreDAO::_fromRow (   $row)

Internal function to return a Genre object from a row.

Parameters
$rowarray
Returns
Genre

Definition at line 192 of file GenreDAO.inc.php.

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

Referenced by getById(), and getByKey().

◆ deleteByContextId()

GenreDAO::deleteByContextId (   $contextId)

Delete the genre entries associated with a context. Called when deleting a Context in ContextDAO.

Parameters
$contextIdint Context ID

Definition at line 287 of file GenreDAO.inc.php.

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

◆ deleteById()

GenreDAO::deleteById (   $genreId)

Soft delete a genre by id.

Parameters
$genreIdint Genre ID

Definition at line 275 of file GenreDAO.inc.php.

References DAO\update().

Referenced by deleteObject().

◆ deleteObject()

GenreDAO::deleteObject (   $genre)

Delete a genre by id.

Parameters
$genreGenre

Definition at line 267 of file GenreDAO.inc.php.

References deleteById().

◆ deleteSettingsByLocale()

GenreDAO::deleteSettingsByLocale (   $locale)

Remove all settings associated with a locale

Parameters
$localestring Locale code

Definition at line 382 of file GenreDAO.inc.php.

References DAO\update().

◆ getByContextId()

GenreDAO::getByContextId (   $contextId,
  $rangeInfo = null 
)

Retrieve all genres

Parameters
$contextIdint
$rangeInfoobject optional
Returns
DAOResultFactory containing matching genres

Definition at line 127 of file GenreDAO.inc.php.

References DAO\retrieveRange().

Referenced by deleteByContextId().

◆ getByDependenceAndContextId()

GenreDAO::getByDependenceAndContextId (   $dependentFilesOnly,
  $contextId,
  $rangeInfo = null 
)

Retrieve genres based on whether they are dependent or not.

Parameters
$dependentFilesOnlyboolean
$contextIdint
$rangeInfoobject optional
Returns
DAOResultFactory containing matching genres

Definition at line 72 of file GenreDAO.inc.php.

References DAO\retrieveRange().

◆ getById()

GenreDAO::getById (   $genreId,
  $contextId = null 
)

Retrieve a genre by type id.

Parameters
$genreIdint
Returns
Genre

Definition at line 27 of file GenreDAO.inc.php.

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

◆ getByKey()

GenreDAO::getByKey (   $key,
  $contextId = null 
)

Retrieves the genre associated with a key.

Parameters
$keyString the entry key
$contextIdint Optional context ID
Returns
Genre

Definition at line 143 of file GenreDAO.inc.php.

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

Referenced by installDefaults().

◆ getBySupplementaryAndContextId()

GenreDAO::getBySupplementaryAndContextId (   $supplementaryFilesOnly,
  $contextId,
  $rangeInfo = null 
)

Retrieve genres based on whether they are supplementary or not.

Parameters
$supplementaryFilesOnlyboolean
$contextIdint
$rangeInfoobject optional
Returns
DAOResultFactory

Definition at line 91 of file GenreDAO.inc.php.

References DAO\retrieveRange().

◆ getDefaultKeys()

GenreDAO::getDefaultKeys ( )

Get default keys.

Returns
array List of default keys

Definition at line 348 of file GenreDAO.inc.php.

◆ getEnabledByContextId()

GenreDAO::getEnabledByContextId (   $contextId,
  $rangeInfo = null 
)

Retrieve all genres

Parameters
$contextIdint
$enabledOnlyboolean optional
$rangeInfoobject optional
Returns
DAOResultFactory containing matching genres

Definition at line 52 of file GenreDAO.inc.php.

References DAO\retrieveRange().

◆ getInsertId()

GenreDAO::getInsertId ( )

Get the ID of the last inserted genre.

Returns
int Inserted genre ID

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

References DAO\_getInsertId().

Referenced by insertObject().

◆ getLocaleFieldNames()

GenreDAO::getLocaleFieldNames ( )

Get a list of field names for which data is localized.

Returns
array

Reimplemented from DAO.

Definition at line 164 of file GenreDAO.inc.php.

◆ getPrimaryByContextId()

GenreDAO::getPrimaryByContextId (   $contextId,
  $rangeInfo = null 
)

Retrieve genres that are not supplementary or dependent.

Parameters
$contextIdint
$rangeInfoobject optional
Returns
DAOResultFactory

Definition at line 109 of file GenreDAO.inc.php.

References DAO\retrieveRange().

◆ insertObject()

GenreDAO::insertObject (   $genre)

Insert a new genre.

Parameters
$genreGenre
Returns
int Inserted genre ID

Definition at line 215 of file GenreDAO.inc.php.

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

Referenced by installDefaults().

◆ installDefaults()

GenreDAO::installDefaults (   $contextId,
  $locales 
)

Install default data for settings.

Parameters
$contextIdint Context ID
$localesarray List of locale codes

Definition at line 310 of file GenreDAO.inc.php.

References getByKey(), insertObject(), newDataObject(), AppLocale\requireComponents(), and updateObject().

◆ keyExists()

GenreDAO::keyExists (   $key,
  $contextId,
  $genreId = null 
)

If a key exists for a context.

Parameters
$keystring
$contextIdint
$genreIdint (optional) Current genre to be ignored
Returns
boolean

Definition at line 366 of file GenreDAO.inc.php.

References DAO\retrieveRange().

◆ newDataObject()

GenreDAO::newDataObject ( )

Construct a new data object corresponding to this DAO.

Returns
Genre

Definition at line 183 of file GenreDAO.inc.php.

Referenced by _fromRow(), and installDefaults().

◆ updateLocaleFields()

GenreDAO::updateLocaleFields (   $genre)

Update the settings for this object

Parameters
$genreobject

Definition at line 172 of file GenreDAO.inc.php.

References DAO\updateDataObjectSettings().

Referenced by insertObject(), and updateObject().

◆ updateObject()

GenreDAO::updateObject (   $genre)

Update an existing genre.

Parameters
$genreGenre

Definition at line 240 of file GenreDAO.inc.php.

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

Referenced by installDefaults().


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