Open Monograph Press  1.1
 All Classes Namespaces Functions Variables Groups Pages
PublishedMonograph.inc.php
1 <?php
2 
18 import('classes.monograph.Monograph');
19 
20 // Access status
21 define('ARTICLE_ACCESS_ISSUE_DEFAULT', 0);
22 define('ARTICLE_ACCESS_OPEN', 1);
23 
25 
29  function PublishedMonograph() {
30  parent::Monograph();
31  }
32 
37  function getViews() {
38  $application = Application::getApplication();
39  return $application->getPrimaryMetricByAssoc(ASSOC_TYPE_MONOGRAPH, $this->getId());
40  }
41 
46  function setViews($views) {
47  return $this->setData('views', $views);
48  }
49 
54  function getAudience() {
55  return $this->getData('audience');
56  }
57 
62  function setAudience($audience) {
63  return $this->setData('audience', $audience);
64  }
65 
71  return $this->getData('audienceRangeQualifier');
72  }
73 
78  function setAudienceRangeQualifier($audienceRangeQualifier) {
79  return $this->setData('audienceRangeQualifier', $audienceRangeQualifier);
80  }
81 
86  function getAudienceRangeFrom() {
87  return $this->getData('audienceRangeFrom');
88  }
89 
94  function setAudienceRangeFrom($audienceRangeFrom) {
95  return $this->setData('audienceRangeFrom', $audienceRangeFrom);
96  }
97 
102  function getAudienceRangeTo() {
103  return $this->getData('audienceRangeTo');
104  }
105 
110  function setAudienceRangeTo($audienceRangeTo) {
111  return $this->setData('audienceRangeTo', $audienceRangeTo);
112  }
113 
119  return $this->getData('audienceRangeExact');
120  }
121 
126  function setAudienceRangeExact($audienceRangeExact) {
127  return $this->setData('audienceRangeExact', $audienceRangeExact);
128  }
129 
135  function getPublicationFormats($onlyApproved = false) {
136  $publicationFormatDao = DAORegistry::getDAO('PublicationFormatDAO');
137  if ($onlyApproved) {
138  $formats = $publicationFormatDao->getApprovedBySubmissionId($this->getId());
139  } else {
140  $formats = $publicationFormatDao->getBySubmissionId($this->getId());
141  }
142  return $formats->toArray();
143  }
144 
150  $separator = ', ';
151  $formats = $this->getPublicationFormats(true);
152  $str = '';
153 
154  foreach ($formats as $format) { /* @var $format PublicationFormat */
155  if (!empty($str)) {
156  $str .= $separator;
157  }
158  $str .= $format->getLocalizedName();
159  }
160 
161  return $str;
162  }
163 
169  $formats = $this->getPublicationFormats();
170  return (sizeof($formats) > 0);
171  }
172 
178  function getCategories() {
179  $publishedMonographDao = DAORegistry::getDAO('PublishedMonographDAO');
180  return $publishedMonographDao->getCategories(
181  $this->getId(),
182  $this->getPressId()
183  );
184  }
185 
190  function getCoverImage() {
191  return $this->getData('coverImage');
192  }
193 
198  function setCoverImage($coverImage) {
199  return $this->setData('coverImage', $coverImage);
200  }
201 
209  function isAvailable() {
210  $publicationFormats = $this->getPublicationFormats(true);
211  if (sizeof($publicationFormats) > 0 && $this->isMetadataApproved()) {
212  return true;
213  }
214  return false;
215  }
216 
221  function getSuppliers() {
222  $representativeDao = DAORegistry::getDAO('RepresentativeDAO');
223  return $representativeDao->getSuppliersByMonographId($this->getId());
224  }
225 
230  function getAgents() {
231  $representativeDao = DAORegistry::getDAO('RepresentativeDAO');
232  return $representativeDao->getAgentsByMonographId($this->getId());
233  }
234 }
235 
236 ?>
static & getDAO($name, $dbconn=null)
Class for a Monograph.
setAudienceRangeFrom($audienceRangeFrom)
setAudienceRangeQualifier($audienceRangeQualifier)
& getData($key, $locale=null)
setAudienceRangeTo($audienceRangeTo)
getPublicationFormats($onlyApproved=false)
Published monograph class.
setData($key, $value, $locale=null)
setAudienceRangeExact($audienceRangeExact)