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(1307)

1295 
1296     private function queryOneMany()
1297     {
1298         $relation=$this->relation;
1299         $model=CActiveRecord::model($relation->className);
1300         $builder=$model->getCommandBuilder();
1301         $schema=$builder->getSchema();
1302         $table=$model->getTableSchema();
1303         $parent=$this->_parent;
1304         $pkTable=$parent->model->getTableSchema();
1305 
1306         $fks=preg_split('/\s*,\s*/',$relation->foreignKey,-1,PREG_SPLIT_NO_EMPTY);
1307         if(count($fks)!==count($pkTable->primaryKey))
1308             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}".',
1309                         array('{class}'=>get_class($parent->model), '{relation}'=>$relation->name, '{table}'=>$pkTable->name)));
1310 
1311         // set up mapping between fk and pk columns
1312         $map=array();  // pk=>fk
1313         foreach($fks as $i=>$fk)
1314         {
1315             if(!isset($table->columns[$fk]))
1316                 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}".',
1317                     array('{class}'=>get_class($parent->model), '{relation}'=>$relation->name, '{key}'=>$fk, '{table}'=>$table->name)));
1318 
1319             if(isset($table->foreignKeys[$fk]))

Stack Trace

#5
+
 /home/activity/domains/activities.rwb.ac.th/public_html/protected/models/Activity.php(84): CActiveRecord->__get("registered")
79             'users' => array(self::MANY_MANY, 'User', 'activity_user(activity_id, user_id)'),
80             'reportlogs' => array(self::HAS_MANY, 'ReportLog', 'activity_id'),
81         );
82     }
83     public function getRemaining() {
84         return max(0, $this->slots - $this->registered);
85     }
86     public function hasUser($user) {
87         return ActivityUser::model()->find('activity_id=:activity_id AND user_id=:user_id', array(
88             ':activity_id' => $this->id,
89             ':user_id' => $user->id,
#18
+
 /home/activity/domains/activities.rwb.ac.th/public_html/protected/widgets/ActivityGridView.php(98): CBaseListView->run()
093             ),
094         );
095         DtQTip::tooltip('#' . $this->id . ' .can-register', array('style' => array('name' => 'green')) + $baseconfig);
096         DtQTip::tooltip('#' . $this->id . ' .cannot-register', array('style' => array('name' => 'red')) + $baseconfig);
097         DtQTip::tooltip('#' . $this->id . ' .is-owner', array('style' => array('name' => 'cream')) + $baseconfig);
098         return parent::run();
099     }
100     
101 }
102 
103 
#20
+
 /home/activity/domains/activities.rwb.ac.th/public_html/protected/views/activity/index.php(9): CBaseController->widget("ActivityGridView")
04 ?>
05 
06 <h1><?php echo Yii::t('activity', 'All Activities'); ?></h1>
07 
08 <?php
09 $this->widget('ActivityGridView');
10 ?>
11 
12 <?php if ($this->user && $this->user->admin): ?>
13 <?php echo CHtml::link(DtHtml::button(Yii::t('activity', 'New Activity'), array('color' => 'default')), array('create')); ?>
14 <?php endif; ?>
2024-03-19 13:43:33 Apache/2 Yii Framework/1.1.6