PHP Error

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

/home/activity/domains/activities.rwb.ac.th/public_html/framework/db/ar/CActiveFinder.php(546)

534                     break;
535                 }
536             }
537 
538             if(!$fkDefined)
539             {
540                 $parentCondition=array();
541                 $childCondition=array();
542                 $count=0;
543                 $params=array();
544                 foreach($fks as $i=>$fk)
545                 {
546                     if($i<count($parent->_table->primaryKey))
547                     {
548                         $pk=is_array($parent->_table->primaryKey) ? $parent->_table->primaryKey[$i] : $parent->_table->primaryKey;
549                         $parentCondition[$pk]=$joinAlias.'.'.$schema->quoteColumnName($fk).'=:ypl'.$count;
550                         $params[':ypl'.$count]=$record->$pk;
551                         $count++;
552                     }
553                     else
554                     {
555                         $j=$i-count($parent->_table->primaryKey);
556                         $pk=is_array($this->_table->primaryKey) ? $this->_table->primaryKey[$j] : $this->_table->primaryKey;
557                         $childCondition[$pk]=$this->getColumnPrefix().$schema->quoteColumnName($pk).'='.$joinAlias.'.'.$schema->quoteColumnName($fk);
558                     }

Stack Trace

#4
+
 /home/activity/domains/activities.rwb.ac.th/public_html/protected/views/activity/view.php(82): CActiveRecord->__get("users")
77 
78 <?php
79 
80 $users = '';
81 
82 foreach ($model->users as $user) {
83     $users .= '<li>' . h($user->formattedName) . '</li>';
84 }
85 
86 if ($this->isOwner) {
87     $users .= '<li>' . CHtml::link(Yii::t('activity', 'Manage Teachers'), array('teachers', 'id' => $model->id)) . '</li>';
#9
+
 /home/activity/domains/activities.rwb.ac.th/public_html/protected/controllers/ActivityController.php(63): CController->render("view", array(Activity))
58         $this->render('edit', compact('model', 'attribute'));
59     }
60     
61     public function actionView() {
62         $model = $this->model;
63         $this->render('view', compact('model'));
64     }
65     
66     protected function getUserFromCommand($x) {
67         $x = array_keys($x);
68         if (!empty($x[0])) {
#18
+
 /home/activity/domains/activities.rwb.ac.th/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();
2024-03-29 06:38:28 Apache/2 Yii Framework/1.1.6