當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ConfigInterface::all方法代碼示例

本文整理匯總了PHP中Oro\Bundle\EntityConfigBundle\Config\ConfigInterface::all方法的典型用法代碼示例。如果您正苦於以下問題:PHP ConfigInterface::all方法的具體用法?PHP ConfigInterface::all怎麽用?PHP ConfigInterface::all使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Oro\Bundle\EntityConfigBundle\Config\ConfigInterface的用法示例。


在下文中一共展示了ConfigInterface::all方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: dumpConfig

 /**
  * @param OutputInterface $output
  * @param ConfigInterface $config
  * @param string|null     $attrName
  */
 protected function dumpConfig(OutputInterface $output, ConfigInterface $config, $attrName = null)
 {
     $data = $config->all();
     $res = [$config->getId()->getScope() => $data];
     if (!empty($attrName) && (isset($data[$attrName]) || array_key_exists($attrName, $data))) {
         $res = [$config->getId()->getScope() => [$attrName => $data[$attrName]]];
     }
     $output->writeln(print_r($res, true));
 }
開發者ID:Maksold,項目名稱:platform,代碼行數:14,代碼來源:DebugCommand.php

示例2: calculateConfigChangeSet

 /**
  * @param ConfigInterface $config
  * @SuppressWarnings(PHPMD)
  */
 public function calculateConfigChangeSet(ConfigInterface $config)
 {
     $originConfigValue = array();
     if ($this->originalConfigs->containsKey($config->getId()->toString())) {
         $originConfig = $this->originalConfigs->get($config->getId()->toString());
         $originConfigValue = $originConfig->all();
     }
     foreach ($config->all() as $key => $value) {
         if (!isset($originConfigValue[$key])) {
             $originConfigValue[$key] = null;
         }
     }
     $diffNew = array_udiff_assoc($config->all(), $originConfigValue, function ($a, $b) {
         return $a == $b ? 0 : 1;
     });
     $diffOld = array_udiff_assoc($originConfigValue, $config->all(), function ($a, $b) {
         return $a == $b ? 0 : 1;
     });
     $diff = array();
     foreach ($diffNew as $key => $value) {
         $oldValue = isset($diffOld[$key]) ? $diffOld[$key] : null;
         $diff[$key] = array($oldValue, $value);
     }
     if (!$this->configChangeSets->containsKey($config->getId()->toString())) {
         $this->configChangeSets->set($config->getId()->toString(), array());
     }
     if (count($diff)) {
         $changeSet = array_merge($this->configChangeSets->get($config->getId()->toString()), $diff);
         $this->configChangeSets->set($config->getId()->toString(), $changeSet);
     }
 }
開發者ID:ashutosh-srijan,項目名稱:findit_akeneo,代碼行數:35,代碼來源:ConfigManager.php

示例3: changeConfigFieldName

 /**
  * In case of FieldConfigId replaces OLD field name with given NEW one
  *
  * @param ConfigInterface $config
  * @param $newFieldName
  * @return Config|ConfigInterface
  */
 protected function changeConfigFieldName(ConfigInterface $config, $newFieldName)
 {
     $configId = $config->getId();
     if ($configId instanceof FieldConfigId) {
         $newConfigId = new FieldConfigId($configId->getScope(), $configId->getClassName(), $newFieldName, $configId->getFieldType());
         $newConfig = new Config($newConfigId);
         $newConfig->setValues($config->all());
         $config = $newConfig;
     }
     return $config;
 }
開發者ID:nmallare,項目名稱:platform,代碼行數:18,代碼來源:ConfigManager.php

示例4: calculateConfigChangeSet

 /**
  * @param ConfigInterface $config
  * @SuppressWarnings(PHPMD)
  */
 public function calculateConfigChangeSet(ConfigInterface $config)
 {
     $configKey = $this->buildConfigKey($config->getId());
     $originConfigValues = isset($this->originalConfigs[$configKey]) ? $this->originalConfigs[$configKey]->all() : [];
     $configValues = $config->all();
     foreach ($configValues as $key => $value) {
         if (!isset($originConfigValues[$key])) {
             $originConfigValues[$key] = null;
         }
     }
     $diffNew = array_udiff_assoc($configValues, $originConfigValues, function ($a, $b) {
         return $a == $b ? 0 : 1;
     });
     $diffOld = array_udiff_assoc($originConfigValues, $configValues, function ($a, $b) {
         return $a == $b ? 0 : 1;
     });
     $diff = [];
     foreach ($diffNew as $key => $value) {
         $oldValue = isset($diffOld[$key]) ? $diffOld[$key] : null;
         $diff[$key] = [$oldValue, $value];
     }
     if (!empty($diff)) {
         $this->configChangeSets[$configKey] = isset($this->configChangeSets[$configKey]) ? array_merge($this->configChangeSets[$configKey], $diff) : $diff;
     } elseif (!isset($this->configChangeSets[$configKey])) {
         $this->configChangeSets[$configKey] = [];
     }
 }
開發者ID:northdakota,項目名稱:platform,代碼行數:31,代碼來源:ConfigManager.php


注:本文中的Oro\Bundle\EntityConfigBundle\Config\ConfigInterface::all方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。