當前位置: 首頁>>代碼示例>>PHP>>正文


PHP AbstractPluginManager::has方法代碼示例

本文整理匯總了PHP中Zend\ServiceManager\AbstractPluginManager::has方法的典型用法代碼示例。如果您正苦於以下問題:PHP AbstractPluginManager::has方法的具體用法?PHP AbstractPluginManager::has怎麽用?PHP AbstractPluginManager::has使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Zend\ServiceManager\AbstractPluginManager的用法示例。


在下文中一共展示了AbstractPluginManager::has方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: 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

示例2: has

 public function has($name, $checkAbstractFactories = true, $usePeeringServiceManagers = true)
 {
     if (is_string($name)) {
         // internally called with an array [normalizedName, requestedName].
         $this->incrementCallCount('has', $name);
     }
     return parent::has($name, $checkAbstractFactories, $usePeeringServiceManagers);
 }
開發者ID:cross-solution,項目名稱:yawik,代碼行數:8,代碼來源:PluginManagerMock.php

示例3: has

 /**
  * {@inheritDoc}
  */
 public function has($name, $checkAbstractFactories = true, $usePeeringServiceManagers = true)
 {
     return parent::has($name, $checkAbstractFactories, false);
     // Don't look in peering service managers
 }
開發者ID:detailnet,項目名稱:dfw-fileconversion-module,代碼行數:8,代碼來源:AdapterManager.php

示例4: has

 /**
  * Override: do not use peering service managers
  *
  * @param  string|array $name
  * @param  bool         $checkAbstractFactories
  * @param  bool         $usePeeringServiceManagers
  * @return bool
  */
 public function has($name, $checkAbstractFactories = true, $usePeeringServiceManagers = false)
 {
     return parent::has($name, $checkAbstractFactories, $usePeeringServiceManagers);
 }
開發者ID:CHRISTOPHERVANDOMME,項目名稱:zf2complet,代碼行數:12,代碼來源:ControllerManager.php


注:本文中的Zend\ServiceManager\AbstractPluginManager::has方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。