Resolves #52431: Localization of nameLocalized not working in preview of attribute
authorstan <stan@735d13b6-9817-0410-8766-e36946ffe9aa>
Thu, 27 Feb 2014 15:59:10 +0000 (15:59 +0000)
committerstan <stan@735d13b6-9817-0410-8766-e36946ffe9aa>
Thu, 27 Feb 2014 15:59:10 +0000 (15:59 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Extensions/static_info_tables/trunk@84034 735d13b6-9817-0410-8766-e36946ffe9aa

ChangeLog
Classes/Domain/Model/AbstractEntity.php
Classes/Domain/Model/Country.php
Classes/Domain/Model/CountryZone.php
Classes/Domain/Model/Currency.php
Classes/Domain/Model/Language.php
Classes/Domain/Model/Territory.php

index 192547e..9e67712 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2014-02-27  Stanislas Rolland  <typo3@sjbr.ca>
+
+       * Resolves #52431: Localization of nameLocalized not working in preview of attribute
+
 2014-02-21  Stanislas Rolland  <typo3@sjbr.ca>
 
        * Update version to 6.0.9
index 49c2903..cdcbc60 100644 (file)
@@ -33,10 +33,23 @@ use \SJBR\StaticInfoTables\Utility\LocalizationUtility;
 class AbstractEntity extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
 
        /**
+        * Extbase configuration
+        *
+        * @var array
+        */
+       protected $extbaseConfiguration;
+
+       /**
+        * Name of the table from persistence mapping of this model
+        *
+        * @var array
+        */
+       protected $tableName;
+
+       /**
         * Contains the persistence columns mapping of this model
         *
         * @var array
-        * @api
         */
        protected $columnsMapping;
 
@@ -46,9 +59,7 @@ class AbstractEntity extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
        public function initializeObject() {
                $objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
                $configurationManager = $objectManager->get('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManager');
-               $settings = $configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);
-               $this->tableName = $settings['persistence']['classes'][get_class($this)]['mapping']['tableName'];
-               $this->columnsMapping = $settings['persistence']['classes'][get_class($this)]['mapping']['columns'];
+               $this->extbaseConfiguration = $configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);
        }
 
        /**
index 9a5aec4..299f8e1 100644 (file)
@@ -140,6 +140,15 @@ class Country extends AbstractEntity {
        protected $zoneFlag = FALSE;
 
        /**
+        * On initialization, get the columns mapping configuration
+        */
+       public function initializeObject() {
+               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'];
+       }
+
+       /**
         * Sets the address format.
         *
         * @param string $addressFormat
index 07918e4..bf38806 100644 (file)
@@ -78,6 +78,15 @@ class CountryZone extends AbstractEntity {
        protected $nameEn = '';
 
        /**
+        * On initialization, get the columns mapping configuration
+        */
+       public function initializeObject() {
+               parent::initializeObject();
+               $this->tableName = $this->extbaseConfiguration['persistence']['classes']['SJBR\\StaticInfoTables\\Domain\\Model\\CountryZone']['mapping']['tableName'];
+               $this->columnsMapping = $this->extbaseConfiguration['persistence']['classes']['SJBR\\StaticInfoTables\\Domain\\Model\\CountryZone']['mapping']['columns'];
+       }
+
+       /**
         * Sets the country ISO alpha-2 code.
         *
         * @param string $countryIsoCodeA2
index 4943bcc..7d93864 100644 (file)
@@ -113,6 +113,15 @@ class Currency extends AbstractEntity {
        protected $thousandsPoint = '';
 
        /**
+        * On initialization, get the columns mapping configuration
+        */
+       public function initializeObject() {
+               parent::initializeObject();
+               $this->tableName = $this->extbaseConfiguration['persistence']['classes']['SJBR\\StaticInfoTables\\Domain\\Model\\Currency']['mapping']['tableName'];
+               $this->columnsMapping = $this->extbaseConfiguration['persistence']['classes']['SJBR\\StaticInfoTables\\Domain\\Model\\Currency']['mapping']['columns'];
+       }
+
+       /**
         * Sets the number of decimal digits.
         *
         * @param integer $decimalDigits
index d45f014..c620f87 100644 (file)
@@ -86,6 +86,15 @@ class Language extends AbstractEntity {
        protected $typo3Code = '';
 
        /**
+        * On initialization, get the columns mapping configuration
+        */
+       public function initializeObject() {
+               parent::initializeObject();
+               $this->tableName = $this->extbaseConfiguration['persistence']['classes']['SJBR\\StaticInfoTables\\Domain\\Model\\Language']['mapping']['tableName'];
+               $this->columnsMapping = $this->extbaseConfiguration['persistence']['classes']['SJBR\\StaticInfoTables\\Domain\\Model\\Language']['mapping']['columns'];
+       }
+
+       /**
         * Sets the collating locale.
         *
         * @param string $collatingLocale
index e486ae4..124e25b 100644 (file)
@@ -58,6 +58,15 @@ class Territory extends AbstractEntity {
        protected $parentTerritoryUnCodeNumber = 0;
 
        /**
+        * On initialization, get the columns mapping configuration
+        */
+       public function initializeObject() {
+               parent::initializeObject();
+               $this->tableName = $this->extbaseConfiguration['persistence']['classes']['SJBR\\StaticInfoTables\\Domain\\Model\\Territory']['mapping']['tableName'];
+               $this->columnsMapping = $this->extbaseConfiguration['persistence']['classes']['SJBR\\StaticInfoTables\\Domain\\Model\\Territory']['mapping']['columns'];
+       }
+
+       /**
         * Gets the deletion status of the entity
         *
         * @return boolean