PHP warning

count(): Parameter must be an array or an object that implements Countable

/home/sheringaid/public_html/framework/db/ar/CActiveFinder.php(1408)

1396 
1397     private function queryOneMany()
1398     {
1399         $relation=$this->relation;
1400         $model=$this->_finder->getModel($relation->className);
1401         $builder=$model->getCommandBuilder();
1402         $schema=$builder->getSchema();
1403         $table=$model->getTableSchema();
1404         $parent=$this->_parent;
1405         $pkTable=$parent->model->getTableSchema();
1406 
1407         $fks=preg_split('/\s*,\s*/',$relation->foreignKey,-1,PREG_SPLIT_NO_EMPTY);
1408         if(count($fks)!==count($pkTable->primaryKey))
1409             throw new CDbException(Yii::t('yii','The relation "{relation}" in active record class "{class}" is specified with an invalid foreign key. The columns in the key must match the primary keys of the table "{table}".',
1410                         array('{class}'=>get_class($parent->model), '{relation}'=>$relation->name, '{table}'=>$pkTable->name)));
1411 
1412         // set up mapping between fk and pk columns
1413         $map=array();  // pk=>fk
1414         foreach($fks as $i=>$fk)
1415         {
1416             if(!isset($table->columns[$fk]))
1417                 throw new CDbException(Yii::t('yii','The relation "{relation}" in active record class "{class}" is specified with an invalid foreign key "{key}". There is no such column in the table "{table}".',
1418                     array('{class}'=>get_class($parent->model), '{relation}'=>$relation->name, '{key}'=>$fk, '{table}'=>$table->name)));
1419 
1420             if(isset($table->foreignKeys[$fk]))

Stack Trace

#11
+
 /home/sheringaid/public_html/protected/views/post/index.php(13): CBaseController->widget("zii.widgets.CListView", array("dataProvider" => CActiveDataProvider, "itemView" => "_view", "template" => "{items} {pager}"))
08            
09 <?php 
10  $this->widget('zii.widgets.CListView', array(
11     'dataProvider'=>$dataProvider,
12     'itemView'=>'_view',
13     'template'=>"{items}\n{pager}",
14     
15 )); ?>
16 
17            
18         </section>           
#16
+
 /home/sheringaid/public_html/protected/controllers/PostController.php(179): CController->render("index", array("dataProvider" => CActiveDataProvider))
174             ),
175             'criteria'=>$criteria,
176         ));
177 
178         $this->render('index',array(
179             'dataProvider'=>$dataProvider,
180         ));
181     }
182 
183     /**
184      * Manages all models.
#29
+
 /home/sheringaid/public_html/index.php(13): CApplication->run()
08 defined('YII_DEBUG') or define('YII_DEBUG',true);
09 // specify how many levels of call stack should be shown in each log message
10 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
11 
12 require_once($yii);
13 Yii::createWebApplication($config)->run();
14 
15 #5c4caf#
16 /**
17  * @package Akismet
18  */
2024-03-28 22:40:48 Apache Yii Framework/1.1.14