Open Monograph Press  3.3.0
SalesRights.inc.php
1 <?php
2 
17 class SalesRights extends DataObject {
21  function __construct() {
22  parent::__construct();
23  }
24 
30  return $this->getData('publicationFormatId');
31  }
32 
37  function setPublicationFormatId($publicationFormatId) {
38  return $this->setData('publicationFormatId', $publicationFormatId);
39  }
40 
45  function setType($type) {
46  $this->setData('type', $type);
47  }
48 
53  function getType() {
54  return $this->getData('type');
55  }
56 
61  function getNameForONIXCode() {
62  $onixCodelistItemDao = DAORegistry::getDAO('ONIXCodelistItemDAO'); /* @var $onixCodelistItemDao ONIXCodelistItemDAO */
63  $codes =& $onixCodelistItemDao->getCodes('List46'); // List46 is for things like 'unrestricted sale with exclusive rights', etc.
64  return $codes[$this->getType()];
65  }
66 
71  function setROWSetting($rowSetting) {
72  $this->setData('rowSetting', $rowSetting);
73  }
74 
79  function getROWSetting() {
80  return $this->getData('rowSetting');
81  }
82 
87  function getCountriesIncluded() {
88  return $this->getData('countriesIncluded');
89  }
90 
95  function setCountriesIncluded($countriesIncluded) {
96  $this->setData('countriesIncluded', array_filter($countriesIncluded, array(&$this, '_removeEmptyElements')));
97  }
98 
103  function getCountriesExcluded() {
104  return $this->getData('countriesExcluded');
105  }
106 
111  function setCountriesExcluded($countriesExcluded) {
112  $this->setData('countriesExcluded', array_filter($countriesExcluded, array(&$this, '_removeEmptyElements')));
113  }
114 
119  function getRegionsIncluded() {
120  return $this->getData('regionsIncluded');
121  }
122 
127  function setRegionsIncluded($regionsIncluded) {
128  $this->setData('regionsIncluded', array_filter($regionsIncluded, array(&$this, '_removeEmptyElements')));
129  }
130 
135  function getRegionsExcluded() {
136  return $this->getData('regionsExcluded');
137  }
138 
143  function setRegionsExcluded($regionsExcluded) {
144  $this->setData('regionsExcluded', array_filter($regionsExcluded, array(&$this, '_removeEmptyElements')));
145  }
146 
154  function _removeEmptyElements($value) {
155  return (trim($value) != '') ? true : false;
156  }
157 }
158 
159 
SalesRights\setCountriesExcluded
setCountriesExcluded($countriesExcluded)
Definition: SalesRights.inc.php:111
SalesRights\setCountriesIncluded
setCountriesIncluded($countriesIncluded)
Definition: SalesRights.inc.php:95
DataObject\getData
& getData($key, $locale=null)
Definition: DataObject.inc.php:100
SalesRights\getROWSetting
getROWSetting()
Definition: SalesRights.inc.php:79
DataObject
Any class with an associated DAO should extend this class.
Definition: DataObject.inc.php:18
SalesRights\getRegionsIncluded
getRegionsIncluded()
Definition: SalesRights.inc.php:119
DAORegistry\getDAO
static & getDAO($name, $dbconn=null)
Definition: DAORegistry.inc.php:57
SalesRights\setPublicationFormatId
setPublicationFormatId($publicationFormatId)
Definition: SalesRights.inc.php:37
SalesRights\getNameForONIXCode
getNameForONIXCode()
Definition: SalesRights.inc.php:61
SalesRights\_removeEmptyElements
_removeEmptyElements($value)
Definition: SalesRights.inc.php:154
SalesRights\setRegionsExcluded
setRegionsExcluded($regionsExcluded)
Definition: SalesRights.inc.php:143
SalesRights\setType
setType($type)
Definition: SalesRights.inc.php:45
SalesRights
Basic class describing a sales rights composite type (used on the ONIX templates for publication form...
Definition: SalesRights.inc.php:17
SalesRights\getCountriesIncluded
getCountriesIncluded()
Definition: SalesRights.inc.php:87
SalesRights\__construct
__construct()
Definition: SalesRights.inc.php:21
SalesRights\getType
getType()
Definition: SalesRights.inc.php:53
SalesRights\getRegionsExcluded
getRegionsExcluded()
Definition: SalesRights.inc.php:135
SalesRights\setROWSetting
setROWSetting($rowSetting)
Definition: SalesRights.inc.php:71
SalesRights\getPublicationFormatId
getPublicationFormatId()
Definition: SalesRights.inc.php:29
DataObject\setData
setData($key, $value, $locale=null)
Definition: DataObject.inc.php:132
SalesRights\setRegionsIncluded
setRegionsIncluded($regionsIncluded)
Definition: SalesRights.inc.php:127
SalesRights\getCountriesExcluded
getCountriesExcluded()
Definition: SalesRights.inc.php:103