di\ServiceLocator has()

has() public method

Returns a value indicating whether the locator has the specified component definition or has instantiated the component.

This method may return different results depending on the value of $checkInstance.

  • If $checkInstance is false (default), the method will return a value indicating whether the locator has the specified component definition.
  • If $checkInstance is true, the method will return a value indicating whether the locator has instantiated the specified component.

See also set().

public boolean has ( $id, $checkInstance = false )
$id string

Component ID (e.g. db).

$checkInstance boolean

Whether the method should check if the component is shared and instantiated.

return boolean

Whether the locator has the specified component definition or has instantiated the component.

doc_Yii
2016-10-30 17:01:10
Comments
Leave a Comment

Please login to continue.