mazraara
(Mazraara)
1
Hi All,
I am missing something i guess and not able to get this thing worked…
i have a scope defined as below
public function scopes() {
return array(
'undeleted'=>array(
'condition'=>'deleted=\'0\'',
),
);
}
and i am calling it this way,…
ModelCall::model()->findByPk($id)->undeleted()
this is not doing me the expected thing…
instead if i had used it like following it works…
ModelClass::model()->findByPk($id, "deleted='0'")
Let me know whether scope doesnt work with findByPk or what…
Any help is greatly appreciated…
Thanks
Azy
Shareek
(Shareek Now)
2
Bump
I am having similar kind of issue… 
Please help me out
Thanks
softark
(Softark)
3
You have to apply the scope(s) before you execute the query.
ModelCall::model()->undeleted()->findByPk($id);
mazraara
(Mazraara)
4
tnx a lot 
i messed with this thing…