Open Journal Systems  3.0.0
 All Classes Namespaces Functions Variables Groups Pages
ReviewFilesDAO.inc.php
1 <?php
2 
17 class ReviewFilesDAO extends DAO {
21  function ReviewFilesDAO() {
22  parent::DAO();
23  }
24 
30  function grant($reviewId, $fileId) {
31  $this->update(
32  'INSERT INTO review_files
33  (review_id, file_id)
34  VALUES
35  (?, ?)',
36  array(
37  (int) $reviewId,
38  (int) $fileId
39  )
40  );
41  }
42 
48  function revoke($reviewId, $fileId) {
49  $this->update(
50  'DELETE FROM review_files WHERE review_id = ? AND file_id = ?',
51  array(
52  (int) $reviewId,
53  (int) $fileId
54  )
55  );
56  }
57 
62  function revokeByReviewId($reviewId) {
63  $this->update(
64  'DELETE FROM review_files WHERE review_id = ?',
65  (int) $reviewId
66  );
67  }
68 
75  function check($reviewId, $fileId) {
76  $result = $this->retrieve(
77  'SELECT * FROM review_files WHERE review_id = ? AND file_id = ?',
78  array((int) $reviewId, (int) $fileId)
79  );
80 
81  $returner = $result->RecordCount();
82  $result->Close();
83  return $returner;
84  }
85 }
86 
87 ?>
Operations for managing review round / submission file associations. These control which files are av...
Operations for retrieving and modifying objects from a database.
Definition: DAO.inc.php:30
grant($reviewId, $fileId)
revoke($reviewId, $fileId)
& retrieve($sql, $params=false, $callHooks=true)
Definition: DAO.inc.php:84
check($reviewId, $fileId)
revokeByReviewId($reviewId)
update($sql, $params=false, $callHooks=true, $dieOnError=true)
Definition: DAO.inc.php:208