本文整理汇总了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();
}
示例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);
}
}
示例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);
}
示例4: __construct
/**
* Constructor.
*
* @param string $parent The id of Definition instance to decorate.
*/
public function __construct($parent)
{
parent::__construct();
$this->parent = $parent;
}
示例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);
}
示例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');
}
示例7: __construct
public function __construct($model, array $title, array $description)
{
parent::__construct('%symedit_seo.model.preference.class%', [$model, $title, $description]);
}
示例8: __construct
public function __construct($class, array $services)
{
parent::__construct($class, [$class, $services]);
$this->setFactory([AmbiguousService::class, 'throwException']);
$this->services = $services;
}