public function __set($name, $value)
{
if (method_exists($this, $setter = 'set' . $name)) {
if (strncasecmp($name, 'js', 2) === 0 && $value && !$value instanceof TJavaScriptLiteral) {
$value = new TJavaScriptLiteral($value);
}
return $this->{$setter}($value);
} else {
if (method_exists($this, $jssetter = 'setjs' . $name)) {
if ($value && !$value instanceof TJavaScriptString) {
$value = new TJavaScriptString($value);
}
return $this->{$jssetter}($value);
} else {
if (strncasecmp($name, 'on', 2) === 0 && method_exists($this, $name) || strncasecmp($name, 'fx', 2) === 0) {
return $this->attachEventHandler($name, $value);
} else {
if ($this->_m !== null && $this->_m->getCount() > 0 && $this->_behaviorsenabled) {
$sets = 0;
foreach ($this->_m->toArray() as $behavior) {
if ((!$behavior instanceof IBehavior || $behavior->getEnabled()) && (property_exists($behavior, $name) || $behavior->canSetProperty($name) || $behavior->hasEvent($name))) {
$behavior->{$name} = $value;
$sets++;
}
}
if ($sets) {
return $value;
}
}
}
}
}
if (method_exists($this, 'get' . $name) || method_exists($this, 'getjs' . $name)) {
throw new TInvalidOperationException('component_property_readonly', get_class($this), $name);
} else {
throw new TInvalidOperationException('component_property_undefined', get_class($this), $name);
}
}