Open Journal Systems  3.3.0
PKPSectionDAO.inc.php
1 <?php
2 
17 abstract class PKPSectionDAO extends DAO {
18 
23  abstract function newDataObject();
24 
32  abstract function getById($sectionId, $contextId = null);
33 
39  function _fromRow($row) {
40  $section = $this->newDataObject();
41 
42  $section->setReviewFormId($row['review_form_id']);
43  $section->setEditorRestricted($row['editor_restricted']);
44  $section->setSequence($row['seq']);
45 
46  return $section;
47  }
48 
53  function getLocaleFieldNames() {
54  return array_merge(parent::getLocaleFieldNames(), array('title', 'policy'));
55  }
56 
61  function deleteObject($section) {
62  return $this->deleteById($section->getId(), $section->getContextId());
63  }
64 
70  abstract function deleteById($sectionId, $contextId = null);
71 
77  function deleteByContextId($contextId) {
78  $sections = $this->getByContextId($contextId);
79  while ($section = $sections->next()) {
80  $this->deleteObject($section);
81  }
82  }
83 
92  abstract function getByContextId($contextId, $rangeInfo = null, $submittableOnly = false);
93 
101  function getTitlesByContextId($contextId, $submittableOnly = false) {
102  $sections = array();
103  $sectionsIterator = $this->getByContextId($contextId, null, $submittableOnly);
104  while ($section = $sectionsIterator->next()) {
105  $sections[$section->getId()] = $section->getLocalizedTitle();
106  }
107  return $sections;
108  }
109 }
110 
111 
PKPSectionDAO\_fromRow
_fromRow($row)
Definition: PKPSectionDAO.inc.php:39
PKPSectionDAO\getTitlesByContextId
getTitlesByContextId($contextId, $submittableOnly=false)
Definition: PKPSectionDAO.inc.php:101
PKPSectionDAO\deleteObject
deleteObject($section)
Definition: PKPSectionDAO.inc.php:61
PKPSectionDAO\getLocaleFieldNames
getLocaleFieldNames()
Definition: PKPSectionDAO.inc.php:53
PKPSectionDAO\newDataObject
newDataObject()
PKPSectionDAO
Operations for retrieving and modifying Section objects.
Definition: PKPSectionDAO.inc.php:17
PKPSectionDAO\getByContextId
getByContextId($contextId, $rangeInfo=null, $submittableOnly=false)
PKPSectionDAO\deleteById
deleteById($sectionId, $contextId=null)
PKPSectionDAO\deleteByContextId
deleteByContextId($contextId)
Definition: PKPSectionDAO.inc.php:77
PKPSectionDAO\getById
getById($sectionId, $contextId=null)
DAO
Operations for retrieving and modifying objects from a database.
Definition: DAO.inc.php:31