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


PHP Definition::__construct方法代码示例

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


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

示例1: __construct

    /**
     * Constructor.
     *
     * @param string $parent The id of Definition instance to decorate.
     *
     * @api
     */
    public function __construct($parent)
    {
        parent::__construct();

        $this->parent = $parent;
        $this->changes = array();
    }
开发者ID:n3b,项目名称:symfony,代码行数:14,代码来源:DefinitionDecorator.php

示例2: __construct

 /**
  * Construct a definition.
  *
  * To avoid confusion, use the setters constructArgs() and addMethod().
  *
  * @param string $className       Name of the class (with full namespace if applicable).
  * @param array  $constructorArgs Non associative array of parameters.
  * @param array  $methods         Associative array of array($method => array(0 => array($param1, $param2...),
  *                                                                            1 => array($param1, $param2...).
  */
 public function __construct($className, array $constructorArgs = array(), array $methods = array())
 {
     parent::__construct($className, $constructorArgs);
     if ($methods) {
         $this->setMethods($methods);
     }
 }
开发者ID:Silwereth,项目名称:core,代码行数:17,代码来源:Definition.php

示例3: __construct

 /**
  * Constructor.
  *
  * @param string $bundle A bundle name or empty string
  * @param string $engine The templating engine
  * @param array  $dirs   An array of directories to merge
  */
 public function __construct($bundle, $engine, array $dirs)
 {
     if (!count($dirs)) {
         throw new \InvalidArgumentException('You must provide at least one directory.');
     }
     parent::__construct();
     $this->addTag('assetic.templating.' . $engine)->addTag('assetic.formula_resource', array('loader' => $engine));
     if (1 == count($dirs)) {
         // no need to coalesce
         self::configureDefinition($this, $bundle, $engine, reset($dirs));
         return;
     }
     // gather the wrapped resource definitions
     $resources = array();
     foreach ($dirs as $dir) {
         $resources[] = $resource = new Definition();
         self::configureDefinition($resource, $bundle, $engine, $dir);
     }
     $this->setClass('%assetic.coalescing_directory_resource.class%')->addArgument($resources)->setPublic(false);
 }
开发者ID:sanborino,项目名称:clinica,代码行数:27,代码来源:DirectoryResourceDefinition.php

示例4: __construct

 /**
  * Constructor.
  *
  * @param string $parent The id of Definition instance to decorate.
  */
 public function __construct($parent)
 {
     parent::__construct();
     $this->parent = $parent;
 }
开发者ID:eigentor,项目名称:tommiblog,代码行数:10,代码来源:DefinitionDecorator.php

示例5: __construct

 public function __construct($bundle)
 {
     parent::__construct();
     $this->setClass('%symedit_theme.template.loader.bundle.class%')->addTag('symedit_theme.template_loader')->addArgument($bundle)->addArgument(new Reference('kernel'))->setPublic(false);
 }
开发者ID:symedit,项目名称:symedit,代码行数:5,代码来源:BundleTemplateLoaderDefinition.php

示例6: __construct

 /**
  * Constructor
  *
  * @param string $flagsPath
  * @param array  $patterns
  * @param array  $defaults
  */
 public function __construct($flagsPath, array $patterns, array $defaults)
 {
     parent::__construct();
     $this->setClass('%server_grove_locale.flag_cache_warmer.class%')->setPublic(false)->addArgument('%kernel.root_dir%')->addArgument($flagsPath)->addArgument($patterns)->addArgument($defaults)->addArgument('%server_grove_locale.enabled_locales%')->addTag('kernel.cache_warmer');
 }
开发者ID:servergrove,项目名称:servergrovelocalebundle,代码行数:12,代码来源:CacheWarmerDefinition.php

示例7: __construct

 public function __construct($model, array $title, array $description)
 {
     parent::__construct('%symedit_seo.model.preference.class%', [$model, $title, $description]);
 }
开发者ID:symedit,项目名称:symedit,代码行数:4,代码来源:SeoPreferenceDefinition.php

示例8: __construct

 public function __construct($class, array $services)
 {
     parent::__construct($class, [$class, $services]);
     $this->setFactory([AmbiguousService::class, 'throwException']);
     $this->services = $services;
 }
开发者ID:symfonette,项目名称:class-named-services,代码行数:6,代码来源:AmbiguousDefinition.php


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