yii\base\Object::canSetProperty PHP Method

canSetProperty() public method

A property is writable if: - the class has a setter method associated with the specified name (in this case, property name is case-insensitive); - the class has a member variable with the specified name (when $checkVars is true);
See also: canGetProperty()
public canSetProperty ( string $name, boolean $checkVars = true ) : boolean
$name string the property name
$checkVars boolean whether to treat member variables as properties
return boolean whether the property can be written
    public function canSetProperty($name, $checkVars = true)
    {
        return method_exists($this, 'set' . $name) || $checkVars && property_exists($this, $name);
    }