public canGetProperty ( string $name, boolean $checkVars = true, boolean $checkBehaviors = true ) : boolean | ||
$name | string | the property name |
$checkVars | boolean | whether to treat member variables as properties |
$checkBehaviors | boolean | whether to treat behaviors' properties as properties of this component |
return | boolean | whether the property can be read |
public function canGetProperty($name, $checkVars = true, $checkBehaviors = true)
{
if (method_exists($this, 'get' . $name) || $checkVars && property_exists($this, $name)) {
return true;
} elseif ($checkBehaviors) {
$this->ensureBehaviors();
foreach ($this->_behaviors as $behavior) {
if ($behavior->canGetProperty($name, $checkVars)) {
return true;
}
}
}
return false;
}
/** * @inheritdoc */ public function canGetProperty($name, $checkVars = true, $checkBehaviors = true) { if (property_exists($this->obj, $name)) { return true; } return parent::canGetProperty($name, $checkVars, $checkBehaviors); }