Open Journal Systems  3.3.0
Representation.inc.php
1 <?php
2 
16 import('lib.pkp.classes.core.DataObject');
17 
18 class Representation extends DataObject {
22  function __construct() {
23  // Switch on meta-data adapter support.
24  $this->setHasLoadableAdapters(true);
25 
26  parent::__construct();
27  }
28 
33  function getSequence() {
34  return $this->getData('seq');
35  }
36 
41  function setSequence($seq) {
42  $this->setData('seq', $seq);
43  }
44 
49  function getLocalizedName() {
50  return $this->getLocalizedData('name');
51  }
52 
58  function getName($locale) {
59  return $this->getData('name', $locale);
60  }
61 
67  function setName($name, $locale = null) {
68  $this->setData('name', $name, $locale);
69  }
70 
75  function getIsApproved() {
76  return (boolean) $this->getData('isApproved');
77  }
78 
83  function setIsApproved($isApproved) {
84  return $this->setData('isApproved', $isApproved);
85  }
86 
94  function getStoredPubId($pubIdType) {
95  return $this->getData('pub-id::'.$pubIdType);
96  }
97 
105  function setStoredPubId($pubIdType, $pubId) {
106  $this->setData('pub-id::'.$pubIdType, $pubId);
107  }
108 
114  function getRemoteURL() {
115  return $this->getData('urlRemote');
116  }
117 
123  function setRemoteURL($remoteURL) {
124  return $this->setData('urlRemote', $remoteURL);
125  }
126 
131  function getContextId() {
132  $publication = Services::get('publication')->get($this->getData('publicationId'));
133  $submissionDao = DAORegistry::getDAO('SubmissionDAO'); /* @var $submissionDao SubmissionDAO */
134  $submission = $submissionDao->getById($publication->getData('submissionId'));
135  return $submission->getContextId();
136  }
137 
141  function getDAO() {
143  }
144 
145  function getRepresentationFiles($fileStage = null) {
146  $publication = Services::get('publication')->get($this->getData('publicationId'));
147  $submissionFileDao = DAORegistry::getDAO('SubmissionFileDAO');
148  return $submissionFileDao->getLatestRevisionsByAssocId(
149  ASSOC_TYPE_REPRESENTATION,
150  $this->getId(),
151  $publication->getData('submissionId'),
152  $fileStage,
153  null
154  );
155  }
156 }
157 
158 
DataObject\getData
& getData($key, $locale=null)
Definition: DataObject.inc.php:100
DataObject\getLocalizedData
getLocalizedData($key, $preferredLocale=null)
Definition: DataObject.inc.php:71
Representation\__construct
__construct()
Definition: Representation.inc.php:22
Representation\setStoredPubId
setStoredPubId($pubIdType, $pubId)
Definition: Representation.inc.php:105
Application\getRepresentationDAO
static getRepresentationDAO()
Definition: Application.inc.php:162
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
Representation\getLocalizedName
getLocalizedName()
Definition: Representation.inc.php:49
Representation\getContextId
getContextId()
Definition: Representation.inc.php:131
Representation\getSequence
getSequence()
Definition: Representation.inc.php:33
Representation\getName
getName($locale)
Definition: Representation.inc.php:58
Representation\getDAO
getDAO()
Definition: Representation.inc.php:141
Representation\getRemoteURL
getRemoteURL()
Definition: Representation.inc.php:114
Representation\setRemoteURL
setRemoteURL($remoteURL)
Definition: Representation.inc.php:123
Representation\setSequence
setSequence($seq)
Definition: Representation.inc.php:41
Representation\getIsApproved
getIsApproved()
Definition: Representation.inc.php:75
DataObject\setHasLoadableAdapters
setHasLoadableAdapters($hasLoadableAdapters)
Definition: DataObject.inc.php:255
DataObject\getId
getId()
Definition: DataObject.inc.php:206
Representation\setName
setName($name, $locale=null)
Definition: Representation.inc.php:67
Representation
A submission's representation (Publication Format, Galley, ...)
Definition: Representation.inc.php:18
Representation\setIsApproved
setIsApproved($isApproved)
Definition: Representation.inc.php:83
Representation\getRepresentationFiles
getRepresentationFiles($fileStage=null)
Definition: Representation.inc.php:145
DataObject\setData
setData($key, $value, $locale=null)
Definition: DataObject.inc.php:132
Representation\getStoredPubId
getStoredPubId($pubIdType)
Definition: Representation.inc.php:94
PKPServices\get
static get($service)
Definition: PKPServices.inc.php:49