How to add a column alias into yii active record model?
In my old project I used long id for table primary key, like 'shop_id' or
'order_id', but now I want to use just 'id' as alias for 'shop_id'. How to
add this to the model class only, not changing tables. After that I'd like
to have something like this
$model->id = $var
or
$var = $model->id
and
$var = $model->attributes['id'].
No comments:
Post a Comment