According to the reference, the CDbCriteria property ‘scopes’ is only valid for the find%() methods.
How could I use a cumulative scope?
For example, in a model of people, I have a scope to filter only those male and another scope to filter the boys, using the previous scope to enclose only the males? (this is a minimal example, my need was generated by very complex scopes).
It would be something like this:
public function scopes()
{
return array(
'male'=>array(
'condition'=>"sex = 'M'",
),
'boy'=>array(
'scopes'=>'male',
'condition'=>"age < 15",
),
);
}
But I would very much like a scope inherit the properties of another, not to be necessary to use chain of methods.
As I said earlier, I have complex scopes that are self related. If I have to use the chain, whenever needed to change my scope I have to scan multiple files to correct the chain of methods.
So I asked if anyone has an interesting solution to my problem.