Open Journal Systems  3.3.0
Query.inc.php
1 <?php
2 
17 import('lib.pkp.classes.note.NoteDAO'); // Constants
18 
19 class Query extends DataObject {
20 
25  function getAssocType() {
26  return $this->getData('assocType');
27  }
28 
33  function setAssocType($assocType) {
34  $this->setData('assocType', $assocType);
35  }
36 
41  function getAssocId() {
42  return $this->getData('assocId');
43  }
44 
49  function setAssocId($assocId) {
50  $this->setData('assocId', $assocId);
51  }
52 
57  function getStageId() {
58  return $this->getData('stageId');
59  }
60 
65  function setStageId($stageId) {
66  return $this->setData('stageId', $stageId);
67  }
68 
73  function getSequence() {
74  return $this->getData('sequence');
75  }
76 
81  function setSequence($sequence) {
82  $this->setData('sequence', $sequence);
83  }
84 
89  function getIsClosed() {
90  return $this->getData('closed');
91  }
92 
97  function setIsClosed($isClosed) {
98  return $this->setData('closed', $isClosed);
99  }
100 
105  function getHeadNote() {
106  $notes = $this->getReplies(null, NOTE_ORDER_DATE_CREATED, SORT_DIRECTION_ASC, true);
107  $note = $notes->next();
108  $notes->close();
109  return $note;
110  }
111 
120  function getReplies($userId = null, $sortBy = NOTE_ORDER_ID, $sortOrder = SORT_DIRECTION_ASC, $isAdmin = false) {
121  $noteDao = DAORegistry::getDAO('NoteDAO'); /* @var $noteDao NoteDAO */
122  return $noteDao->getByAssoc(ASSOC_TYPE_QUERY, $this->getId(), null, $sortBy, $sortOrder, $isAdmin);
123  }
124 }
125 
126 
Query\setSequence
setSequence($sequence)
Definition: Query.inc.php:81
Query\getAssocId
getAssocId()
Definition: Query.inc.php:41
DataObject\getData
& getData($key, $locale=null)
Definition: DataObject.inc.php:100
Query\setStageId
setStageId($stageId)
Definition: Query.inc.php:65
DataObject
Any class with an associated DAO should extend this class.
Definition: DataObject.inc.php:18
DAORegistry\getDAO
static & getDAO($name, $dbconn=null)
Definition: DAORegistry.inc.php:57
Query\getHeadNote
getHeadNote()
Definition: Query.inc.php:105
Query\setAssocId
setAssocId($assocId)
Definition: Query.inc.php:49
Query\getAssocType
getAssocType()
Definition: Query.inc.php:25
Query\getIsClosed
getIsClosed()
Definition: Query.inc.php:89
Query\setAssocType
setAssocType($assocType)
Definition: Query.inc.php:33
Query\getSequence
getSequence()
Definition: Query.inc.php:73
DataObject\getId
getId()
Definition: DataObject.inc.php:206
Query
Class for Query.
Definition: Query.inc.php:19
Query\setIsClosed
setIsClosed($isClosed)
Definition: Query.inc.php:97
Query\getReplies
getReplies($userId=null, $sortBy=NOTE_ORDER_ID, $sortOrder=SORT_DIRECTION_ASC, $isAdmin=false)
Definition: Query.inc.php:120
DataObject\setData
setData($key, $value, $locale=null)
Definition: DataObject.inc.php:132
Query\getStageId
getStageId()
Definition: Query.inc.php:57