本文整理匯總了PHP中Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition::prototype方法的典型用法代碼示例。如果您正苦於以下問題:PHP ArrayNodeDefinition::prototype方法的具體用法?PHP ArrayNodeDefinition::prototype怎麽用?PHP ArrayNodeDefinition::prototype使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition
的用法示例。
在下文中一共展示了ArrayNodeDefinition::prototype方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getMultipleQueuesConfiguration
protected function getMultipleQueuesConfiguration()
{
$node = new ArrayNodeDefinition('queues');
$prototypeNode = $node->prototype('array');
$this->addQueueNodeConfiguration($prototypeNode);
$prototypeNode->children()->scalarNode('callback')->isRequired()->end()->end();
$prototypeNode->end();
return $node;
}
示例2: getHosts
private function getHosts()
{
$node = new ArrayNodeDefinition('hosts');
$node->prototype('scalar')->end();
return $node;
}
示例3: configure
public function configure(ArrayNodeDefinition $builder)
{
$builder->prototype('variable');
}
示例4: testPrototypeEnum
public function testPrototypeEnum()
{
$node = new ArrayNodeDefinition('root');
$this->assertEquals($node->prototype('enum'), $node->enumPrototype());
}
示例5: getCellsNode
/**
* @return ArrayNodeDefinition
*/
protected function getCellsNode()
{
$node = new ArrayNodeDefinition('cells');
$node->prototype('array')->children()->scalarNode('name')->cannotBeEmpty()->isRequired()->end()->scalarNode('searcher')->cannotBeEmpty()->isRequired()->end()->scalarNode('transformer')->defaultNull()->end()->scalarNode('class')->defaultValue(self::CELL_CLASS)->end()->scalarNode('service')->defaultValue(null)->end()->end();
return $node;
}
示例6: configure
/**
* @param ArrayNodeDefinition $builder
*/
public function configure(ArrayNodeDefinition $builder)
{
$builder->prototype('array')->children()->enumNode('type')->values(['local', 'remote'])->defaultValue('local')->end()->scalarNode('base_dir')->defaultNull()->end()->scalarNode('ssh_command')->defaultValue('ssh')->end()->scalarNode('ssh_options')->defaultNull()->end()->end()->end();
}
示例7: getServicesDefinition
protected function getServicesDefinition()
{
$node = new ArrayNodeDefinition('services');
$node->prototype('array')->children()->scalarNode('class')->isRequired()->end()->variableNode('parameters')->defaultValue(array())->end()->end()->end();
return $node;
}
示例8: getRoutesNode
/**
* Node for routing - only
*
* @return ArrayNodeDefinition
*/
private function getRoutesNode()
{
$node = new ArrayNodeDefinition('routes');
$node->prototype('array')->children()->scalarNode('security')->defaultNull()->end()->arrayNode('serialization_groups')->prototype('scalar')->end()->defaultValue(['Default'])->end()->end()->end();
return $node;
}