From e79e0de51f1d9658ab0b36733c656b2e929514b2 Mon Sep 17 00:00:00 2001 From: Christian Fasching Date: Fri, 23 Jun 2017 13:07:32 +0200 Subject: [PATCH] fixed #3 - Remove Zend Dependencies --- src/ConfigElement/Operator/Concatenator.php | 5 +++-- src/OutputDefinition.php | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/ConfigElement/Operator/Concatenator.php b/src/ConfigElement/Operator/Concatenator.php index 74d853f..f114e4d 100644 --- a/src/ConfigElement/Operator/Concatenator.php +++ b/src/ConfigElement/Operator/Concatenator.php @@ -40,7 +40,7 @@ public function getLabeledValue($object) { $childs = $this->getChilds(); $valueArray = []; - + foreach($childs as $c) { $value = $c->getLabeledValue($object)->value; @@ -51,7 +51,8 @@ public function getLabeledValue($object) { } if($this->formatNumbers && is_numeric($value)) { - $value = \Zend_Locale_Format::toNumber($value, array("locale" => \Zend_Registry::get("Zend_Locale")) ); + $formattingService = \Pimcore::getContainer()->get('pimcore.locale.intl_formatter'); + $value = $formattingService->formatNumber($value); } if($value !== null) { diff --git a/src/OutputDefinition.php b/src/OutputDefinition.php index c458dcc..ff36410 100644 --- a/src/OutputDefinition.php +++ b/src/OutputDefinition.php @@ -33,7 +33,7 @@ public static function getByO_IdClassIdChannel($o_id, $classId, $channel) { $cacheKey = self::getCacheKey($o_id, $classId, $channel); try { - $config = \Zend_Registry::get($cacheKey); + $config = \Pimcore\Cache\Runtime::get($cacheKey); } catch (\Exception $e) { @@ -45,7 +45,7 @@ public static function getByO_IdClassIdChannel($o_id, $classId, $channel) { Logger::info($e->getMessage()); $config = null; } - \Zend_Registry::set($cacheKey, $config); + \Pimcore\Cache\Runtime::set($cacheKey, $config); } catch(\Exception $ex) { Logger::debug($ex->getMessage()); return null; @@ -64,7 +64,7 @@ public static function getById($id) { } catch(\Exception $ex) { Logger::debug($ex->getMessage()); return null; - } + } } private static function getCacheKey($o_id, $classId, $channel) { @@ -93,7 +93,7 @@ public function save() { */ public function delete() { $cacheKey = self::getCacheKey($this->getO_id(), $this->getO_ClassId(), $this->getChannel()); - \Zend_Registry::set($cacheKey, null); + \Pimcore\Cache\Runtime::set($cacheKey, null); $this->getDao()->delete(); }