Open Journal Systems  3.3.0
SettingsDAO Class Reference
Inheritance diagram for SettingsDAO:
DAO ControlledVocabEntrySettingsDAO JournalSettingsDAO

Public Member Functions

 _buildObject (&$node, $paramArray=array())
 
 _cacheMiss ($cache, $id)
 
 _getCache ($id)
 
 _installer_regexp_callback ($matches)
 
 _performReplacement ($rawInput, $paramArray=array())
 
 deleteById ($id)
 
 deleteSetting ($id, $name, $locale=null)
 
getSetting ($id, $name, $locale=null)
 
getSettings ($id)
 
 installSettings ($id, $filename, $paramArray=array())
 
 loadSettings ($id)
 
 updateSetting ($id, $name, $value, $type=null, $isLocalized=false)
 
- 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 ()
 
 getLocaleFieldNames ()
 
 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)
 

Protected Member Functions

 _getCacheName ()
 
 _getPrimaryKeyColumn ()
 
 _getTableName ()
 
- Protected Member Functions inherited from DAO
 _getInsertId ($table='', $id='')
 

Additional Inherited Members

- Static Public Member Functions inherited from DAO
static getDataChangedEvent ($elementId=null, $parentElementId=null, $content='')
 
- Data Fields inherited from DAO
 $_dataSource
 

Detailed Description

Operations for retrieving and modifying settings.

Definition at line 16 of file SettingsDAO.inc.php.

Member Function Documentation

◆ _buildObject()

SettingsDAO::_buildObject ( $node,
  $paramArray = array() 
)

Used internally by installSettings to recursively build nested arrays. Deals with translation and variable replacement calls.

Parameters
$nodeobject XMLNode <array> tag
$paramArrayarray Parameters to be replaced in key/value contents

Definition at line 117 of file SettingsDAO.inc.php.

References _performReplacement().

Referenced by installSettings().

◆ _cacheMiss()

SettingsDAO::_cacheMiss (   $cache,
  $id 
)

Callback for a cache miss.

Parameters
$cacheCache
$idstring
Returns
mixed

Definition at line 88 of file SettingsDAO.inc.php.

References loadSettings().

◆ _getCache()

SettingsDAO::_getCache (   $id)

Get the settings cache for a given ID

Parameters
$id
Returns
array|null (Null indicates caching disabled)

Definition at line 260 of file SettingsDAO.inc.php.

References _getCacheName(), and CacheManager\getManager().

Referenced by deleteById(), deleteSetting(), getSetting(), getSettings(), loadSettings(), and updateSetting().

◆ _getCacheName()

SettingsDAO::_getCacheName ( )
protected

Get the cache name.

Returns
string|null Null disables caching.

Definition at line 293 of file SettingsDAO.inc.php.

Referenced by _getCache().

◆ _getPrimaryKeyColumn()

SettingsDAO::_getPrimaryKeyColumn ( )
abstractprotected

Get the primary key column name.

Reimplemented in ControlledVocabEntrySettingsDAO, and JournalSettingsDAO.

Referenced by deleteById(), deleteSetting(), loadSettings(), and updateSetting().

◆ _getTableName()

SettingsDAO::_getTableName ( )
abstractprotected

Get the settings table name.

Returns
string

Reimplemented in JournalSettingsDAO, and ControlledVocabEntrySettingsDAO.

Referenced by deleteById(), deleteSetting(), loadSettings(), and updateSetting().

◆ _installer_regexp_callback()

SettingsDAO::_installer_regexp_callback (   $matches)

Used internally by conference setting installation code to perform translation function.

Definition at line 177 of file SettingsDAO.inc.php.

◆ _performReplacement()

SettingsDAO::_performReplacement (   $rawInput,
  $paramArray = array() 
)

Used internally by installSettings to perform variable and translation replacements.

Parameters
$rawInputstring contains text including variable and/or translate replacements.
$paramArrayarray contains variables for replacement
Returns
string

Definition at line 103 of file SettingsDAO.inc.php.

Referenced by _buildObject(), and installSettings().

◆ deleteById()

SettingsDAO::deleteById (   $id)

Delete all settings for an ID.

Parameters
$idint

Definition at line 245 of file SettingsDAO.inc.php.

References _getCache(), _getPrimaryKeyColumn(), _getTableName(), and DAO\update().

◆ deleteSetting()

SettingsDAO::deleteSetting (   $id,
  $name,
  $locale = null 
)

Delete a setting.

Parameters
$idint
$namestring

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

References _getCache(), _getPrimaryKeyColumn(), _getTableName(), and DAO\update().

◆ getSetting()

& SettingsDAO::getSetting (   $id,
  $name,
  $locale = null 
)

Retrieve a setting value.

Parameters
$idint
$namestring
$localestring optional
Returns
mixed

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

References _getCache(), and loadSettings().

◆ getSettings()

& SettingsDAO::getSettings (   $id)

Retrieve cached settings, using the cache if available.

Parameters
$idint
Returns
array Associative array of settings.

Definition at line 50 of file SettingsDAO.inc.php.

References _getCache(), and loadSettings().

◆ installSettings()

SettingsDAO::installSettings (   $id,
  $filename,
  $paramArray = array() 
)

Install conference settings from an XML file.

Parameters
$idint ID of scheduled conference/conference for settings to apply to
$filenamestring Name of XML file to parse and install
$paramArrayarray Optional parameters for variable replacement in settings

Definition at line 141 of file SettingsDAO.inc.php.

References _buildObject(), _performReplacement(), AppLocale\getLocale(), and updateSetting().

◆ loadSettings()

SettingsDAO::loadSettings (   $id)

Retrieve (and newly cache) all settings.

Parameters
$idint
Returns
array Associative array of settings.

Definition at line 22 of file SettingsDAO.inc.php.

References _getCache(), _getPrimaryKeyColumn(), _getTableName(), DAO\convertFromDB(), and DAO\retrieve().

Referenced by _cacheMiss(), getSetting(), and getSettings().

◆ updateSetting()

SettingsDAO::updateSetting (   $id,
  $name,
  $value,
  $type = null,
  $isLocalized = false 
)

Add/update a setting.

Parameters
$idint
$namestring
$valuemixed
$typestring data type of the setting. If omitted, type will be guessed
$isLocalizedboolean

Definition at line 189 of file SettingsDAO.inc.php.

References _getCache(), _getPrimaryKeyColumn(), _getTableName(), DAO\convertToDB(), DAO\replace(), and DAO\update().

Referenced by installSettings().


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