当前位置: 首页>>代码示例>>PHP>>正文


PHP ArrayNodeDefinition::end方法代码示例

本文整理汇总了PHP中Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition::end方法的典型用法代码示例。如果您正苦于以下问题:PHP ArrayNodeDefinition::end方法的具体用法?PHP ArrayNodeDefinition::end怎么用?PHP ArrayNodeDefinition::end使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition的用法示例。


在下文中一共展示了ArrayNodeDefinition::end方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: addProvidersNode

 protected function addProvidersNode(ArrayNodeDefinition $rootNode)
 {
     $rootNode->ignoreExtraKeys()->fixXmlConfig('factory', 'factories')->children();
     foreach ($this->providers as $provider) {
         $factory = isset($this->factories[$provider]) ? $this->factories[$provider] : null;
         if ($factory === null) {
             throw new \LogicException(sprintf('No factory found for the provider "%s"', $provider));
         }
         $factoryNode = $rootNode->children()->arrayNode($provider)->isRequired();
         $factory->addConfiguration($factoryNode);
     }
     $rootNode->end();
     return $rootNode;
 }
开发者ID:aritoru,项目名称:KPhoenSmsSenderBundle,代码行数:14,代码来源:ProvidersConfiguration.php

示例2: buildEntitiesPropertiesNode

 private function buildEntitiesPropertiesNode()
 {
     $entitiesPropertiesNode = new ArrayNodeDefinition('properties');
     $prototype = $entitiesPropertiesNode->info('List of properties of entity')->prototype('array');
     foreach ($this->treeConfigurators as $configurator) {
         foreach ((array) $configurator->appendEntitiesPropertiesNode() as $node) {
             $prototype->append($node);
         }
     }
     $prototype->children()->scalarNode('type')->info('type of data, standard type of other entity name')->example('DateTime')->cannotBeEmpty()->beforeNormalization()->always(function ($v) {
         return strtolower($v);
     })->end()->validate()->ifTrue(function ($v) {
         return !$this->typeFactory->isValidType($v);
     })->thenInvalid('Invalid Type %s')->end()->end()->scalarNode('cardinality')->info('type of cardinality OneToMany, ManyToMany')->example('(0..1)')->cannotBeEmpty()->end()->scalarNode('accessorPrefix')->info('Prefix used has accessor method : prefixPropertieName')->example('is, has, get')->defaultValue('get')->end()->scalarNode('enum')->info('Name of target enum')->cannotBeEmpty()->end()->scalarNode('entity')->info('name of target entity')->example('DateTime')->cannotBeEmpty()->end()->scalarNode('inverse')->info('define oposite property in cas of relation')->example('MyEntity::propertieName')->cannotBeEmpty()->end()->booleanNode('nullable')->info('Is this propertie is nullable?')->defaultFalse()->end()->booleanNode('primary')->info('Is this propertie is primary key ?')->defaultFalse()->end()->booleanNode('autoincrement')->info('Is this propertie is auto incremented ?')->defaultFalse()->end()->booleanNode('unique')->info('Is this propertie is unique?')->defaultFalse()->end()->variableNode('default')->info('Default value of propertie')->end()->integerNode('length')->info('Max length for string type')->min(0)->end()->integerNode('precision')->info('Number of decimal for float type')->min(1)->max(15)->end();
     $entitiesPropertiesNode->end();
     return $entitiesPropertiesNode;
 }
开发者ID:alborq,项目名称:schema-generator,代码行数:17,代码来源:ConfigurationTree.php

示例3: configure

 /**
  * {@inheritdoc}
  */
 public function configure(ArrayNodeDefinition $builder)
 {
     $builder->end();
 }
开发者ID:ralfmaxxx,项目名称:behat_multidimensional_extension,代码行数:7,代码来源:NestedTableNodeExtension.php


注:本文中的Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition::end方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。