本文整理匯總了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;
}
示例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);
}
示例3: has
/**
* {@inheritDoc}
*/
public function has($name, $checkAbstractFactories = true, $usePeeringServiceManagers = true)
{
return parent::has($name, $checkAbstractFactories, false);
// Don't look in peering service managers
}
示例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);
}