Hey guys. I need your help. I want my cActiveRecord to display all related records as specified in my criteria the problem is the findAll method doesnt seems to work. I did use find() and it only returns the first record here’s my code. Please help thanks
public function actionAdmin()
{
$model=new MenuCategory('search');
$model->unsetAttributes(); // clear any default values
$this->store_name = Yii::app()->user->getState('store_id');
$store=Store::model()->find('id=:id', array(':id'=>$this->store_name));
$this->store_name = $store->name." - ".$store->address." ".$store->city;
if(isset($_GET['MenuCategory']))
$model->attributes=$_GET['MenuCategory'];
//get related record
$Criteria = new CDbCriteria();
$Criteria->condition = "store_id = $store->id";
$model = MenuCategory::model()->findAll($Criteria);
$this->render('admin',array(
'model'=>$model,
));
}
this code returns a error while using find() returns 1 row