当前位置: 首页>>代码示例>>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;未经允许,请勿转载。