class Model extends CActiveRecord
{
public $maxPos;
}
class PositionBehavior extends CActiveRecordBehavior
{
function someMethod()
{
$owner = $this->getOwner();
$criteria = new CDbCriteria;
$criteria->select='MAX(position) as maxPos';
$position = $owner::model()->find($criteria);
}
}
If I want to get clear model class without any vars as $maxPos how can I attach public attribute $maxPos to CActiveRecord model from CActiveRecordBehavior class? It is possible? Or how I can get $position->maxPos variable without public property in Model? Thanks!