我遇到了一个问题:我需要更改供应商捆绑配置。我怎样才能正确地做到这一点?
供应商捆绑配置:
namespace Oro\Bundle\DataGridBundle\Extension\Toolbar;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
use Oro\Bundle\ConfigBundle\Config\ConfigManager;
class Configuration implements ConfigurationInterface
{
/** @var int */
private $defaultPerPage;
/**
* @param ConfigManager $cm
*/
public function __construct(ConfigManager $cm)
{
$this->defaultPerPage = $cm->get('oro_data_grid.default_per_page');
}
/**
* {@inheritDoc}
*/
public function getConfigTreeBuilder()
{
$builder = new TreeBuilder();
$builder->root('toolbarOptions')
->children()
->booleanNode('hide')->defaultFalse()->end()
->booleanNode('addResetAction')->defaultTrue()->end()
->booleanNode('addRefreshAction')->defaultTrue()->end()
->integerNode('turnOffToolbarRecordsNumber')->defaultValue(0)->end()
->arrayNode('pageSize')->addDefaultsIfNotSet()
->children()
->booleanNode('hide')->defaultFalse()->end()
->scalarNode('default_per_page')->defaultValue($this->defaultPerPage)->end()
->arrayNode('items')
->defaultValue([10, 25, 50, 100])
->prototype('variable')->end()
->end()
->end()
->end()
->arrayNode('pagination')
->addDefaultsIfNotSet()
->children()
->booleanNode('hide')->defaultFalse()->end()
->end()
->end()
->end();
return $builder;
}
}
问题是 - 如何->arrayNode('items')
在不编辑 bundle configuration.php 的情况下更改为我的自定义数组?