You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want use getter in CActiveRecord as sortableAttribute. For do this please change in TbExtendedGridView
/**
*### .getAttribute()
*
* Helper function to get an attribute from the data
*
* @param CActiveRecord $data
* @param string $attribute the attribute to get
*
* @return mixed the attribute value null if none found
*/
protected function getAttribute($data, $attribute)
{
if ($this->dataProvider instanceof CActiveDataProvider)
{
if ($data->hasAttribute($attribute))
{
return $data->{$attribute};
}
$method = 'get' . ucfirst($attribute);
if (is_object($data) && method_exists($data, $method))
{
return call_user_func([$data, $method]);
}
}
if ($this->dataProvider instanceof CArrayDataProvider || $this->dataProvider instanceof CSqlDataProvider) {
if (is_object($data) && isset($data->{$attribute})) {
return $data->{$attribute};
}
if (isset($data[$attribute])) {
return $data[$attribute];
}
}
return null;
}
The text was updated successfully, but these errors were encountered:
I want use getter in CActiveRecord as sortableAttribute. For do this please change in TbExtendedGridView
The text was updated successfully, but these errors were encountered: