本文整理汇总了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);
}