Resolves #58107: Add countryZones to country domain model
authorstan <stan@735d13b6-9817-0410-8766-e36946ffe9aa>
Tue, 22 Apr 2014 21:18:13 +0000 (21:18 +0000)
committerstan <stan@735d13b6-9817-0410-8766-e36946ffe9aa>
Tue, 22 Apr 2014 21:18:13 +0000 (21:18 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Extensions/static_info_tables/trunk@84958 735d13b6-9817-0410-8766-e36946ffe9aa

ChangeLog
Classes/Domain/Model/AbstractEntity.php
Classes/Domain/Model/Country.php
Configuration/TypoScript/Extbase/setup.txt

index 7944bd9..f8cd100 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,8 @@
        * Resolves #58100: Incorrect annotation for tableName on AbstractEntity
        * Resolves #58101: Make extension incompatible with extension "uncache"
        * Resolves #56327: Add select viewHelper with values from tables (Thanks to Carsten Biebricher)
+       * Resolves #58100: Incorrect annotation for tableName on AbstractEntity
+       * Resolves #58107: Add countryZones to country domain model
 
 2014-03-26  Stanislas Rolland  <typo3@sjbr.ca>
 
index d1865c3..4d56ca3 100644 (file)
@@ -54,11 +54,16 @@ class AbstractEntity extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
        protected $columnsMapping;
 
        /**
+        * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
+        */
+       protected $objectManager;
+
+       /**
         * On initialization, get the columns mapping configuration
         */
        public function initializeObject() {
-               $objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
-               $configurationManager = $objectManager->get('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManager');
+               $this->objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
+               $configurationManager = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManager');
                $this->extbaseConfiguration = $configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);
        }
 
index 299f8e1..31f7c1b 100644 (file)
@@ -42,6 +42,14 @@ class Country extends AbstractEntity {
        protected $capitalCity = '';
 
        /**
+        * Country zones of this country
+        *
+        * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\SJBR\StaticInfoTables\Domain\Model\CountryZone>
+        * @lazy
+        */
+       protected $countryZones;
+
+       /**
         * Currency code as number (i.e. 978)
         * ISO 4217 Nr Currency code
         * @var integer
@@ -146,6 +154,7 @@ class Country extends AbstractEntity {
                parent::initializeObject();
                $this->tableName = $this->extbaseConfiguration['persistence']['classes']['SJBR\\StaticInfoTables\\Domain\\Model\\Country']['mapping']['tableName'];
                $this->columnsMapping = $this->extbaseConfiguration['persistence']['classes']['SJBR\\StaticInfoTables\\Domain\\Model\\Country']['mapping']['columns'];
+               $this->countryZones = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage');
        }
 
        /**
@@ -528,5 +537,25 @@ class Country extends AbstractEntity {
        public function getZoneFlag() {
                return $this->zoneFlag;
        }
+
+       /**
+        * Sets the country zones
+        *
+        * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\SJBR\StaticInfoTables\Domain\Model\CountryZone> $countryZones
+        *
+        * @return void
+        */
+       public function setCountryZones($countryZones) {
+               $this->countryZones = $countryZones;
+       }
+
+       /**
+        * Gets the country zones
+        *
+        * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\SJBR\StaticInfoTables\Domain\Model\CountryZone> $countryZones
+        */
+       public function getCountryZones() {
+               return $this->countryZones;
+       }
 }
 ?>
\ No newline at end of file
index bb04fc5..5b16991 100644 (file)
@@ -22,6 +22,7 @@ config.tx_extbase {
                                                cn_tldomain.mapOnProperty = topLevelDomain
                                                cn_uno_member.mapOnProperty = unMember
                                                cn_zone_flag.mapOnProperty = zoneFlag
+                                               cn_country_zones.mapOnProperty = countryZones
                                                deleted = deleted
                                        }
                                }