PHP warning

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

/home1/sbg11/yii-1.1.14/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

#5
+
 /home1/sbg11/public_html/gallery/themes/default/views/video/view.php(138): CActiveRecord->__get("commentCount")
133                                 <?php echo number_format((int)$statistics['commentCount']); ?> Youtube Comment<?php echo (int)$statistics['commentCount'] == 1 ? '' : 's'; ?>
134                             </a>
135                             <?php if(Yii::app()->params['commentsOn']) { ?>
136                             <a href="javascript:void(0);" class="post-item">
137                                 <i class="fa fa-comments"></i>
138                                 <?php echo number_format($model->commentCount); ?> System Comment<?php echo $model->commentCount == 1 ? '' : 's'; ?>
139                             </a>
140                             <?php } ?>
141                         </div>
142                         <!-- End Post Infos -->
143                         <!-- Post Description -->
#10
+
 /home1/sbg11/public_html/gallery/protected/controllers/VideoController.php(115): CController->render("view", array("model" => Video, "comment" => Comment, "videos" => array(Video, Video, Video, Video, ...)))
110         $comment = $this->newComment($model);
111         
112         $this->render('view',array(
113             'model'=>$model,
114             'comment'=>$comment,
115             'videos'=>$videos,
116         ));
117     }
118     
119     protected function newComment($model) {
120         $comment=new Comment;
#25
+
 /home1/sbg11/public_html/gallery/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 /*
16 $app = Yii::createWebApplication($config);
17 $params = Yii::app()->db->createCommand()
18 ->select('*')
2024-03-28 04:22:00 Apache Yii Framework/1.1.14