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


PHP AbstractPluginManager::get方法代码示例

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


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

示例1: get

 /**
  * @inheritdoc
  *
  * @param string $name
  * @param array $options
  * @param bool $usePeeringServiceManagers
  * @return JobInterface
  */
 public function get($name, $options = [], $usePeeringServiceManagers = true)
 {
     // parent::get calls validatePlugin() so we're sure $instance is a JobInterface
     $instance = parent::get($name, $options, $usePeeringServiceManagers);
     $instance->setMetadata('__name__', $name);
     return $instance;
 }
开发者ID:jackdpeterson,项目名称:SlmQueue,代码行数:15,代码来源:JobPluginManager.php

示例2: get

 public function get($name, $options = array(), $usePeeringServiceManagers = true)
 {
     $plugin = parent::get($name, $options, $usePeeringServiceManagers);
     $plugin->setConfig($this->getConfig()->{$name});
     $plugin->setObjectManager($this->getObjectManager());
     return $plugin;
 }
开发者ID:i-xperts,项目名称:zf-oauth2-doctrine,代码行数:7,代码来源:MapperManager.php

示例3: get

 /**
  * Override: do not use peering service managers
  *
  * @param  string $name
  * @param  array $options
  * @param  bool $usePeeringServiceManagers
  * @return mixed
  */
 public function get($name, $options = [], $usePeeringServiceManagers = false)
 {
     if (is_string($options)) {
         $options = ['class_name' => $options];
     }
     return parent::get($name, $options, $usePeeringServiceManagers);
 }
开发者ID:coolms,项目名称:common,代码行数:15,代码来源:AbstractPluginManager.php

示例4: get

    /**
     * Retrieve a registered instance
     *
     * After the plugin is retrieved from the service locator, inject the
     * controller in the plugin every time it is requested. This is required
     * because a controller can use a plugin and another controller can be
     * dispatched afterwards. If this second controller uses the same plugin
     * as the first controller, the reference to the controller inside the
     * plugin is lost.
     *
     * @param  string $name
     * @param  mixed  $options
     * @param  bool   $usePeeringServiceManagers
     * @return mixed
     */
    public function get($name, $options = array(), $usePeeringServiceManagers = true)
    {
        $plugin = parent::get($name, $options, $usePeeringServiceManagers);
        $this->injectController($plugin);

        return $plugin;
    }
开发者ID:Robert-Xie,项目名称:php-framework-benchmark,代码行数:22,代码来源:PluginManager.php

示例5: hydrate

 /**
  * Converts the given value so that it can be hydrated by the hydrator.
  *
  * @param mixed $value The original value.
  * @param array $data (optional) The original data for context.
  * @return mixed Returns the value that should be hydrated.
  */
 public function hydrate($value)
 {
     if ($value instanceof StateInterface) {
         return $value;
     }
     if (is_string($value)) {
         if ($this->checkPlugin() && $this->plugins->has($value)) {
             return $this->plugins->get($value);
         }
         throw new \RuntimeException(sprintf('No service registered in %s with name %s', is_object($this->plugins) ? get_class($this->plugins) : gettype($this->plugins), $value));
     }
     if (empty($value) && $this->checkPlugin() && $this->plugins->has($this->firstStateName)) {
         return $this->plugins->has($this->firstStateName);
     }
     // FIXME is correct? or exception
     return $value;
 }
开发者ID:strapieno,项目名称:str-utils,代码行数:24,代码来源:StateStrategy.php

示例6: get

 /**
  * Override get to inject options as PatternOptions instance.
  *
  * {@inheritDoc}
  */
 public function get($plugin, array $options = [], $usePeeringServiceManagers = true)
 {
     if (empty($options)) {
         return parent::get($plugin, [], $usePeeringServiceManagers);
     }
     $plugin = parent::get($plugin, [], $usePeeringServiceManagers);
     $plugin->setOptions(new Pattern\PatternOptions($options));
     return $plugin;
 }
开发者ID:stephenmoore56,项目名称:mooredatabase-laravel,代码行数:14,代码来源:PatternPluginManager.php

示例7: get

 /**
  * {@inheritDoc}
  */
 public function get($name, $options = [], $usePeeringServiceManagers = true)
 {
     try {
         $instance = parent::get($name, $options, $usePeeringServiceManagers);
     } catch (ServiceNotFoundException $e) {
         $instance = new Fallback();
         $instance->setServiceLocator($this->getServiceLocator());
     }
     return $instance;
 }
开发者ID:patrova,项目名称:omeka-s,代码行数:13,代码来源:Manager.php

示例8: get

 /**
  * {@inheritDoc}
  */
 public function get($name, $options = array(), $usePeeringServiceManagers = true)
 {
     $formElementManager = $this->getServiceLocator()->get('FormElementManager');
     if ($formElementManager->has($name)) {
         $form = $formElementManager->get($name);
         if ($form instanceof FormInterface) {
             return $form;
         }
     }
     return parent::get($name, $options, $usePeeringServiceManagers);
 }
开发者ID:rettal,项目名称:zf2-form,代码行数:14,代码来源:FormManager.php

示例9: get

 /**
  * Retrieve a service from the manager by name
  *
  * Allows passing an array of options to use when creating the instance.
  * createFromInvokable() will use these and pass them to the instance
  * constructor if not null and a non-empty array.
  *
  * @param string $name
  * @param array $options
  * @param bool $usePeeringServiceManagers
  * @return object
  * @throws InvalidPluginException
  */
 public function get($name, $options = [], $usePeeringServiceManagers = true)
 {
     // If service not registered check the the Service Locator.
     if (!$this->has($name)) {
         return $this->getServiceLocator()->get($name);
     }
     if (isset($options['initialize'])) {
         $this->initialize = $options['initialize'];
         unset($options['initialize']);
     }
     $instance = parent::get($name, $options, $usePeeringServiceManagers);
     $this->validatePlugin($instance);
     return $instance;
 }
开发者ID:uthando-cms,项目名称:uthando-common,代码行数:27,代码来源:ServiceManager.php

示例10: get

 /**
  * Retrieve a service from the manager by name
  *
  * Allows passing an array of options to use when creating the instance.
  * createFromInvokable() will use these and pass them to the instance
  * constructor if not null and a non-empty array.
  *
  * @param  string $name
  * @param  string|array $options
  * @param  bool $usePeeringServiceManagers
  * @return object
  */
 public function get($name, $options = array(), $usePeeringServiceManagers = true)
 {
     if (is_string($options)) {
         $options = array('name' => $options);
     }
     return parent::get($name, $options, $usePeeringServiceManagers);
 }
开发者ID:gstearmit,项目名称:EshopVegeTable,代码行数:19,代码来源:FormElementManager.php

示例11: get

 /**
  * {@inheritDoc}
  */
 public function get($name, $options = array(), $usePeeringServiceManagers = true)
 {
     return parent::get($name, $options, false);
     // Don't look in peering service managers
 }
开发者ID:detailnet,项目名称:dfw-fileconversion-module,代码行数:8,代码来源:AdapterManager.php

示例12: get

 /**
  * Override: do not use peering service manager to retrieve controller
  *
  * @param  string $name
  * @param  array $options
  * @param  bool $usePeeringServiceManagers
  * @return mixed
  */
 public function get($name, $options = array(), $usePeeringServiceManagers = false)
 {
     return parent::get($name, $options, $usePeeringServiceManagers);
 }
开发者ID:razvansividra,项目名称:pnlzf2-1,代码行数:12,代码来源:ControllerManager.php

示例13: get

 /**
  * {@inheritDoc}
  *
  * @return AbstractPlugin
  */
 public function get($name, $options = array(), $usePeeringServiceManagers = true)
 {
     if (empty($options['name'])) {
         $options['name'] = $name;
     }
     return parent::get($name, $options, $usePeeringServiceManagers);
 }
开发者ID:coolms,项目名称:jquery,代码行数:12,代码来源:JQueryPluginManager.php

示例14: get

 public function get($name, $options = [], $usePeeringServiceManagers = true)
 {
     $this->incrementCallCount('get', $name, $options);
     return parent::get($name, $options, $usePeeringServiceManagers);
 }
开发者ID:cross-solution,项目名称:yawik,代码行数:5,代码来源:PluginManagerMock.php

示例15: get

 /**
  * Retrieve a registered instance
  *
  * After the plugin is retrieved from the service locator, inject the
  * controller in the plugin every time it is requested. This is required
  * because a controller can use a plugin and another controller can be
  * dispatched afterwards. If this second controller uses the same plugin
  * as the first controller, the reference to the controller inside the
  * plugin is lost.
  *
  * @param  string $name
  * @return DispatchableInterface
  */
 public function get($name, array $options = null)
 {
     $plugin = parent::get($name, $options);
     $this->injectController($plugin);
     return $plugin;
 }
开发者ID:zendframework,项目名称:zend-mvc,代码行数:19,代码来源:PluginManager.php


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