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


PHP ConfigManager::getConfigChangeSet方法代碼示例

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


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

示例1: testConfigChangeSet

 public function testConfigChangeSet()
 {
     $configId = new EntityConfigId('entity', self::ENTITY_CLASS);
     $originalConfig = $this->getConfig($configId, ['item1' => true, 'item11' => true, 'item12' => true, 'item2' => 123, 'item21' => 123, 'item22' => 123, 'item3' => 'val2', 'item4' => 'val4', 'item6' => null, 'item7' => 'val7']);
     $this->configCache->expects($this->once())->method('getEntityConfig')->willReturn($originalConfig);
     $this->configManager->getConfig($configId);
     $changedConfig = $this->getConfig($configId, ['item1' => true, 'item11' => 1, 'item12' => false, 'item2' => 123, 'item21' => '123', 'item22' => 456, 'item3' => 'val21', 'item5' => 'val5', 'item6' => 'val6', 'item7' => null]);
     $this->configManager->persist($changedConfig);
     $this->configManager->calculateConfigChangeSet($changedConfig);
     $this->assertEquals(['item12' => [true, false], 'item22' => [123, 456], 'item3' => ['val2', 'val21'], 'item5' => [null, 'val5'], 'item6' => [null, 'val6'], 'item7' => ['val7', null]], $this->configManager->getConfigChangeSet($changedConfig));
 }
開發者ID:Maksold,項目名稱:platform,代碼行數:11,代碼來源:ConfigManagerTest.php

示例2: computeChanges

 /**
  * @param ConfigInterface $config
  * @param ConfigManager   $configManager
  *
  * @return ConfigLogDiff
  */
 protected function computeChanges(ConfigInterface $config, ConfigManager $configManager)
 {
     $configId = $config->getId();
     $internalValues = $configManager->getProvider($configId->getScope())->getPropertyConfig()->getNotAuditableValues($configId);
     $changes = array_diff_key($configManager->getConfigChangeSet($config), $internalValues);
     if (empty($changes)) {
         return null;
     }
     $diff = new ConfigLogDiff();
     $diff->setScope($configId->getScope());
     $diff->setDiff($changes);
     $diff->setClassName($configId->getClassName());
     if ($configId instanceof FieldConfigId) {
         $diff->setFieldName($configId->getFieldName());
     }
     return $diff;
 }
開發者ID:northdakota,項目名稱:platform,代碼行數:23,代碼來源:AuditManager.php


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