Open Journal Systems  3.0.0
 All Classes Namespaces Functions Variables Groups Pages
SubmissionFileSignoffDAO.inc.php
1 <?php
2 
18 import('lib.pkp.classes.signoff.SignoffDAO');
19 
25  parent::SignoffDAO();
26  }
27 
28 
29  //
30  // Public methods
31  //
35  function getById($signoffId) {
36  return parent::getById($signoffId, ASSOC_TYPE_SUBMISSION_FILE);
37  }
38 
50  function build($symbolic, $submissionFileId, $userId = null,
51  $userGroupId = null, $fileId = null, $fileRevision = null) {
52  return parent::build(
53  $symbolic,
54  ASSOC_TYPE_SUBMISSION_FILE, $submissionFileId,
55  $userId, $userGroupId,
56  $fileId, $fileRevision
57  );
58  }
59 
68  function signoffExists($symbolic, $submissionFileId, $userId = null, $userGroupId = null) {
69  return parent::signoffExists($symbolic, ASSOC_TYPE_SUBMISSION_FILE, $userId, $userGroupId);
70  }
71 
75  function newDataObject() {
76  $signoff = parent::newDataObject();
77  $signoff->setAssocType(ASSOC_TYPE_SUBMISSION_FILE);
78  return $signoff;
79  }
80 
93  function getBySymbolic($symbolic, $submissionFileId, $userId = null,
94  $userGroupId = null, $fileId = null, $fileRevision = null) {
95  return parent::getBySymbolic(
96  $symbolic,
97  ASSOC_TYPE_SUBMISSION_FILE, $submissionFileId,
98  $userId, $userGroupId,
99  $fileId, $fileRevision
100  );
101  }
102 
112  function getAllBySymbolic($symbolic, $submissionFileId = null, $userId = null, $userGroupId = null) {
113  return parent::getAllBySymbolic($symbolic, ASSOC_TYPE_SUBMISSION_FILE, $submissionFileId, $userId, $userGroupId);
114  }
115 
125  function getAllBySubmission($submissionId, $symbolic = null, $userId = null, $userGroupId = null, $notCompletedOnly = false) {
126  $sql = 'SELECT s.* FROM signoffs s, submission_files sf WHERE s.assoc_type = ? AND s.assoc_id = sf.file_id AND sf.submission_id = ?';
127  $params = array(ASSOC_TYPE_SUBMISSION_FILE, (int) $submissionId);
128 
129  if ($symbolic) {
130  $sql .= ' AND s.symbolic = ?';
131  $params[] = $symbolic;
132  }
133  if ($userId) {
134  $sql .= ' AND user_id = ?';
135  $params[] = (int) $userId;
136  }
137 
138  if ($userGroupId) {
139  $sql .= ' AND user_group_id = ?';
140  $params[] = (int) $userGroupId;
141  }
142 
143  if ($notCompletedOnly) {
144  $sql .= ' AND date_completed IS NULL';
145  }
146 
147  $result = $this->retrieve($sql, $params);
148  return new DAOResultFactory($result, $this, '_fromRow', array('id'));
149  }
150 }
151 
152 ?>
& retrieve($sql, $params=false, $callHooks=true)
Definition: DAO.inc.php:84
getAllBySubmission($submissionId, $symbolic=null, $userId=null, $userGroupId=null, $notCompletedOnly=false)
getAllBySymbolic($symbolic, $submissionFileId=null, $userId=null, $userGroupId=null)
Extension of SignoffDAO to work with signoffs relating to submission files.
Wrapper around ADORecordSet providing &quot;factory&quot; features for generating objects from DAOs...
Operations for retrieving and modifying Signoff objects.
build($symbolic, $submissionFileId, $userId=null, $userGroupId=null, $fileId=null, $fileRevision=null)
signoffExists($symbolic, $submissionFileId, $userId=null, $userGroupId=null)
getBySymbolic($symbolic, $submissionFileId, $userId=null, $userGroupId=null, $fileId=null, $fileRevision=null)