Open Preprint Systems  3.3.0
SectionDAO Class Reference
Inheritance diagram for SectionDAO:
PKPSectionDAO DAO

Public Member Functions

 _cacheMiss ($cache, $id)
 
 _fromRow ($row)
 
_getCache ()
 
 deleteById ($sectionId, $contextId=null)
 
 deleteByJournalId ($journalId)
 
 getAdditionalFieldNames ()
 
 getAll ($rangeInfo=null)
 
 getByAbbrev ($sectionAbbrev, $journalId, $locale=null)
 
 getByContextId ($journalId, $rangeInfo=null, $submittableOnly=false)
 
 getById ($sectionId, $journalId=null, $useCache=false)
 
 getByJournalId ($journalId, $rangeInfo=null)
 
 getBySubmissionId ($submissionId)
 
 getByTitle ($sectionTitle, $journalId, $locale=null)
 
 getEditorSections ($journalId)
 
 getEmptyByJournalId ($journalId)
 
 getInsertId ()
 
 getLocaleFieldNames ()
 
 insertObject ($section)
 
 newDataObject ()
 
 resequenceSections ($journalId)
 
 sectionExists ($sectionId, $journalId)
 
 updateLocaleFields ($section)
 
 updateObject ($section)
 
- Public Member Functions inherited from PKPSectionDAO
 deleteByContextId ($contextId)
 
 deleteObject ($section)
 
 getById ($sectionId, $contextId=null)
 
 getTitlesByContextId ($contextId, $submittableOnly=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)
 
 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)
 

Data Fields

 $cache
 
- Data Fields inherited from DAO
 $_dataSource
 

Protected Member Functions

 _getContextIdColumnName ()
 
 _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='')
 

Detailed Description

Operations for retrieving and modifying Section objects.

See also
Section

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

Member Function Documentation

◆ _cacheMiss()

SectionDAO::_cacheMiss (   $cache,
  $id 
)

Definition at line 41 of file SectionDAO.inc.php.

References $cache, and getById().

◆ _fromRow()

SectionDAO::_fromRow (   $row)

Internal function to return a Section object from a row.

Parameters
$rowarray
Returns
Section

Reimplemented from PKPSectionDAO.

Definition at line 186 of file SectionDAO.inc.php.

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

Referenced by getByAbbrev(), getById(), getBySubmissionId(), getByTitle(), and getEditorSections().

◆ _getCache()

& SectionDAO::_getCache ( )

Definition at line 47 of file SectionDAO.inc.php.

References $cache, and CacheManager\getManager().

Referenced by getById().

◆ _getContextIdColumnName()

SectionDAO::_getContextIdColumnName ( )
protected

Get the name of the context ID table column

Returns
string

Definition at line 37 of file SectionDAO.inc.php.

◆ _getTableName()

SectionDAO::_getTableName ( )
protected

Get the name of the section table in the database

Returns
string

Definition at line 28 of file SectionDAO.inc.php.

◆ deleteById()

SectionDAO::deleteById (   $sectionId,
  $contextId = null 
)

Delete a section by ID.

Parameters
$sectionIdint Section ID
$contextIdint optional

Reimplemented from PKPSectionDAO.

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

References DAORegistry\getDAO(), sectionExists(), and DAO\update().

◆ deleteByJournalId()

SectionDAO::deleteByJournalId (   $journalId)

Delete sections by journal ID NOTE: This does not delete dependent entries EXCEPT from subeditor_submission_group. It is intended to be called only when deleting a journal.

Parameters
$journalIdint Journal ID

Definition at line 329 of file SectionDAO.inc.php.

References PKPSectionDAO\deleteByContextId().

◆ getAdditionalFieldNames()

SectionDAO::getAdditionalFieldNames ( )

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

Returns
array

Reimplemented from DAO.

Definition at line 221 of file SectionDAO.inc.php.

◆ getAll()

SectionDAO::getAll (   $rangeInfo = null)

Retrieve all sections.

Parameters
$rangeInfoDBResultRange optional
Returns
DAOResultFactory containing Sections ordered by journal ID and sequence

Definition at line 395 of file SectionDAO.inc.php.

References DAO\retrieveRange().

◆ getByAbbrev()

SectionDAO::getByAbbrev (   $sectionAbbrev,
  $journalId,
  $locale = null 
)

Retrieve a section by abbreviation.

Parameters
$sectionAbbrevstring
$journalIdint Journal ID
$localestring optional
Returns
Section

Definition at line 94 of file SectionDAO.inc.php.

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

◆ getByContextId()

SectionDAO::getByContextId (   $journalId,
  $rangeInfo = null,
  $submittableOnly = false 
)

Retrieve all sections for a journal.

Parameters
$journalIdint Journal ID
$rangeInfoDBResultRange optional
$submittableOnlyboolean optional. Whether to return only sections that can be submitted to by anyone.
Returns
DAOResultFactory containing Sections ordered by sequence

Reimplemented from PKPSectionDAO.

Definition at line 381 of file SectionDAO.inc.php.

References DAO\retrieveRange().

Referenced by getByJournalId().

◆ getById()

SectionDAO::getById (   $sectionId,
  $journalId = null,
  $useCache = false 
)

Retrieve a section by ID.

Parameters
$sectionIdint
$journalIdint Journal ID optional
$useCacheboolean optional
Returns
Section

Definition at line 62 of file SectionDAO.inc.php.

References $cache, _fromRow(), _getCache(), and DAO\retrieve().

Referenced by _cacheMiss().

◆ getByJournalId()

SectionDAO::getByJournalId (   $journalId,
  $rangeInfo = null 
)

Retrieve all sections for a journal.

Parameters
$journalIdint Journal ID
$rangeInfoDBResultRange optional
Returns
DAOResultFactory containing Sections ordered by sequence

Definition at line 369 of file SectionDAO.inc.php.

References getByContextId().

◆ getBySubmissionId()

SectionDAO::getBySubmissionId (   $submissionId)

Retrieve section a submission is assigned to.

Parameters
$submissionIdint Submission id
Returns
Section

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

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

◆ getByTitle()

SectionDAO::getByTitle (   $sectionTitle,
  $journalId,
  $locale = null 
)

Retrieve a section by title.

Parameters
$sectionTitlestring
$journalIdint Journal ID
$localestring optional
Returns
Section

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

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

◆ getEditorSections()

SectionDAO::getEditorSections (   $journalId)

Retrieve an array associating all section editor IDs with arrays containing the sections they edit.

Parameters
$journalIdint Journal ID
Returns
array editorId => array(sections they edit)

Definition at line 339 of file SectionDAO.inc.php.

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

◆ getEmptyByJournalId()

SectionDAO::getEmptyByJournalId (   $journalId)

Retrieve all empty (without articles) section ids for a journal.

Parameters
$journalIdint Journal ID
Returns
array

Definition at line 409 of file SectionDAO.inc.php.

References DAO\retrieve().

◆ getInsertId()

SectionDAO::getInsertId ( )

Get the ID of the last inserted section.

Returns
int

Definition at line 470 of file SectionDAO.inc.php.

References DAO\_getInsertId().

Referenced by insertObject().

◆ getLocaleFieldNames()

SectionDAO::getLocaleFieldNames ( )

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

Returns
array

Reimplemented from PKPSectionDAO.

Definition at line 210 of file SectionDAO.inc.php.

◆ insertObject()

SectionDAO::insertObject (   $section)

Insert a new section.

Parameters
$sectionSection
Returns
int new Section ID

Definition at line 243 of file SectionDAO.inc.php.

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

◆ newDataObject()

SectionDAO::newDataObject ( )

Return a new data object.

Reimplemented from PKPSectionDAO.

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

◆ resequenceSections()

SectionDAO::resequenceSections (   $journalId)

Sequentially renumber sections in their sequence order.

Parameters
$journalIdint Journal ID

Definition at line 445 of file SectionDAO.inc.php.

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

◆ sectionExists()

SectionDAO::sectionExists (   $sectionId,
  $journalId 
)

Check if a section exists with the specified ID.

Parameters
$sectionIdint Section ID
$journalIdint Journal ID
Returns
boolean

Definition at line 430 of file SectionDAO.inc.php.

References DAO\retrieve().

Referenced by deleteById().

◆ updateLocaleFields()

SectionDAO::updateLocaleFields (   $section)

Update the localized fields for this table

Parameters
$sectionobject

Definition at line 232 of file SectionDAO.inc.php.

References DAO\updateDataObjectSettings().

Referenced by insertObject(), and updateObject().

◆ updateObject()

SectionDAO::updateObject (   $section)

Update an existing section.

Parameters
$sectionSection

Definition at line 273 of file SectionDAO.inc.php.

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

Field Documentation

◆ $cache

SectionDAO::$cache

Definition at line 21 of file SectionDAO.inc.php.

Referenced by _cacheMiss(), _getCache(), and getById().


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