yii\base\Component::__isset PHP Méthode

__isset() public méthode

This method will check in the following order and act accordingly: - a property defined by a setter: return whether the property is set - a property of a behavior: return whether the property is set - return false for non existing properties Do not call this method directly as it is a PHP magic method that will be implicitly called when executing isset($component->property).
See also: http://php.net/manual/en/function.isset.php
public __isset ( string $name ) : boolean
$name string the property name or the event name
Résultat boolean whether the named property is set
    public function __isset($name)
    {
        $getter = 'get' . $name;
        if (method_exists($this, $getter)) {
            return $this->{$getter}() !== null;
        } else {
            // behavior property
            $this->ensureBehaviors();
            foreach ($this->_behaviors as $behavior) {
                if ($behavior->canGetProperty($name)) {
                    return $behavior->{$name} !== null;
                }
            }
        }
        return false;
    }

Usage Example

Exemple #1
0
 /**
  * @inheritdoc
  */
 public function __isset($name)
 {
     if (property_exists($this->obj, $name)) {
         return $this->obj->{$name} !== null;
     }
     return parent::__isset($name);
 }
All Usage Examples Of yii\base\Component::__isset