本文整理汇总了PHP中Oro\Bundle\EntityConfigBundle\Config\Config::getValues方法的典型用法代码示例。如果您正苦于以下问题:PHP Config::getValues方法的具体用法?PHP Config::getValues怎么用?PHP Config::getValues使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Oro\Bundle\EntityConfigBundle\Config\Config
的用法示例。
在下文中一共展示了Config::getValues方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: changeConfigFieldName
/**
* In case of FieldConfigId replaces OLD field name with given NEW one
*
* @param ConfigInterface $config
* @param string $newFieldName
*
* @return ConfigInterface
*/
protected function changeConfigFieldName(ConfigInterface $config, $newFieldName)
{
$configId = $config->getId();
if ($configId instanceof FieldConfigId) {
$newConfigId = new FieldConfigId($configId->getScope(), $configId->getClassName(), $newFieldName, $configId->getFieldType());
$config = new Config($newConfigId, $config->getValues());
}
return $config;
}
示例2: testSaveFieldConfigValues
public function testSaveFieldConfigValues()
{
$config1 = new Config(new FieldConfigId('scope1', self::ENTITY_CLASS, self::FIELD_NAME, self::FIELD_TYPE), ['key1' => 'val1']);
$config2 = new Config(new FieldConfigId('scope2', self::ENTITY_CLASS, self::FIELD_NAME, self::FIELD_TYPE), ['key2' => 'val2']);
$this->cache->expects($this->once())->method('save')->willReturnCallback(function ($key, $data) {
$this->cache->expects($this->once())->method('fetch')->with($key)->willReturn($data);
return true;
});
$this->assertTrue($this->configCache->saveFieldConfigValues([$config1->getId()->getScope() => $config1->getValues(), $config2->getId()->getScope() => $config2->getValues()], self::ENTITY_CLASS, self::FIELD_NAME, self::FIELD_TYPE));
// test that configs saved right
$this->assertEquals($config1, $this->configCache->getFieldConfig($config1->getId()->getScope(), self::ENTITY_CLASS, self::FIELD_NAME));
$this->assertEquals($config2, $this->configCache->getFieldConfig($config2->getId()->getScope(), self::ENTITY_CLASS, self::FIELD_NAME));
}