• Main Page
  • Modules
  • Classes
  • Files
  • File List

classes/publicationFormat/Market.inc.php

00001 <?php
00002 
00016 class Market extends DataObject {
00020    function Market() {
00021       parent::DataObject();
00022    }
00023 
00028    function getPublicationFormatId() {
00029       return $this->getData('publicationFormatId');
00030    }
00031 
00036    function setPublicationFormatId($publicationFormatId) {
00037       return $this->setData('publicationFormatId', $publicationFormatId);
00038    }
00039 
00044    function getCountriesIncluded() {
00045       return $this->getData('countriesIncluded');
00046    }
00047 
00052    function setCountriesIncluded($countriesIncluded) {
00053       $this->setData('countriesIncluded', array_filter($countriesIncluded, array(&$this, '_removeEmptyElements')));
00054    }
00055 
00060    function getCountriesExcluded() {
00061       return $this->getData('countriesExcluded');
00062    }
00063 
00068    function setCountriesExcluded($countriesExcluded) {
00069       $this->setData('countriesExcluded', array_filter($countriesExcluded, array(&$this, '_removeEmptyElements')));
00070    }
00071 
00076    function getRegionsIncluded() {
00077       return $this->getData('regionsIncluded');
00078    }
00079 
00084    function setRegionsIncluded($regionsIncluded) {
00085       $this->setData('regionsIncluded', array_filter($regionsIncluded, array(&$this, '_removeEmptyElements')));
00086    }
00087 
00092    function getRegionsExcluded() {
00093       return $this->getData('regionsExcluded');
00094    }
00095 
00100    function setRegionsExcluded($regionsExcluded) {
00101       $this->setData('regionsExcluded', array_filter($regionsExcluded, array(&$this, '_removeEmptyElements')));
00102    }
00103 
00108    function getDateRole() {
00109       return $this->getData('dateRole');
00110    }
00111 
00116    function setDateRole($dateRole) {
00117       $this->setData('dateRole', $dateRole);
00118    }
00119 
00124    function getDateFormat() {
00125       return $this->getData('dateFormat');
00126    }
00127 
00132    function setDateFormat($dateFormat) {
00133       $this->setData('dateFormat', $dateFormat);
00134    }
00135 
00140    function getDate() {
00141       return $this->getData('date');
00142    }
00143 
00148    function setDate($date) {
00149       $this->setData('date', $date);
00150    }
00151 
00156    function getCurrencyCode() {
00157       return $this->getData('currencyCode');
00158    }
00159 
00164    function setCurrencyCode($currencyCode) {
00165       return $this->setData('currencyCode', $currencyCode);
00166    }
00167 
00172    function getPrice() {
00173       return $this->getData('price');
00174    }
00175 
00180    function setPrice($price) {
00181       return $this->setData('price', $price);
00182    }
00183 
00188    function getDiscount() {
00189       return $this->getData('discount');
00190    }
00191 
00196    function setDiscount($discount) {
00197       return $this->setData('discount', $discount);
00198    }
00199 
00200 
00205    function getPriceTypeCode() {
00206       return $this->getData('priceTypeCode');
00207    }
00208 
00213    function setPriceTypeCode($priceTypeCode) {
00214       return $this->setData('priceTypeCode', $priceTypeCode);
00215    }
00216 
00221    function getTaxRateCode() {
00222       return $this->getData('taxRateCode');
00223    }
00224 
00229    function setTaxRateCode($taxRateCode) {
00230       return $this->setData('taxRateCode', $taxRateCode);
00231    }
00232 
00237    function getTaxTypeCode() {
00238       return $this->getData('taxTypeCode');
00239    }
00240 
00245    function setTaxTypeCode($taxTypeCode) {
00246       return $this->setData('taxTypeCode', $taxTypeCode);
00247    }
00248 
00253    function getAgentId() {
00254       return $this->getData('agentId');
00255    }
00256 
00261    function setAgentId($agentId) {
00262       return $this->setData('agentId', $agentId);
00263    }
00264 
00269    function getSupplierId() {
00270       return $this->getData('supplierId');
00271    }
00272 
00277    function setSupplierId($supplierId) {
00278       return $this->setData('supplierId', $supplierId);
00279    }
00280 
00285    function getTerritoriesAsString() {
00286       $territories = __('grid.catalogEntry.included');
00287       $territories .= ': ' . join(', ', array_merge($this->getCountriesIncluded(), $this->getRegionsIncluded()));
00288       $territories .= ', ' . __('grid.catalogEntry.excluded');
00289       $territories .= ': ' . join(', ', array_merge($this->getCountriesExcluded(), $this->getRegionsExcluded()));
00290 
00291       return $territories;
00292    }
00293 
00298    function getAssignedRepresentativeNames() {
00299       $representativeDao =& DAORegistry::getDAO('RepresentativeDAO');
00300       $agent =& $representativeDao->getById($this->getAgentId());
00301       $supplier =& $representativeDao->getById($this->getSupplierId());
00302 
00303       $returner = '';
00304 
00305       if (isset($agent) && isset($supplier)) {
00306          $returner = join(', ', array($agent->getName(), $supplier->getName()));
00307       } else if (isset($agent) && !isset($supplier)) {
00308          $returner = $agent->getName();
00309       } else if (isset($supplier)) {
00310          $returner = $supplier->getName();
00311       }
00312 
00313       return $returner;
00314    }
00315 
00323    function _removeEmptyElements($value) {
00324       return (trim($value) != '') ? true : false;
00325    }
00326 }
00327 
00328 ?>

Generated on Mon Sep 17 2012 13:58:55 for Open Monograph Press by  doxygen 1.7.1