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/widgets/TimecheckView.php(162): CActiveRecord->__get("numAbsences")
157                 <td class="pre"></td>';
158         $this->renderCells('cellAttendance', 'td', array(
159             'student' => $student
160         ));
161         echo '
162                 <td class="total">' . (Yii::app()->params['numPeriods'] - $student->numAbsences) . '</td>
163                 <td class="eval-pass' . $this->check($this->getEvaluation($student) == 1) . '"></td>
164                 <td class="eval-fail' . $this->check($this->getEvaluation($student) == -1) . '"></td>
165             </tr>';
166     }
167     protected function cellAttendance($i, $data, &$attr) {
#6
+
 /home/activity/domains/activities.rwb.ac.th/public_html/protected/widgets/TimecheckView.php(129): TimecheckView->renderStudentRow(1, Student)
124             </tr>';
125     }
126     protected function renderBody() {
127         $index = 0;
128         foreach ($this->students as $student) {
129             $this->renderStudentRow(++$index, $student);
130         }
131     }
132     protected function check($cond) {
133         return $cond ? ' check' : '';
134     }
#7
+
 /home/activity/domains/activities.rwb.ac.th/public_html/protected/widgets/TimecheckView.php(34): TimecheckView->renderBody()
29         <thead>';
30         $this->renderHeader();
31         echo '
32         </thead>
33         <tbody>';
34         $this->renderBody();
35         echo '
36         </tbody>
37     </table>
38 </div>';
39         if ($this->editable) {
2024-03-29 04:43:31 Apache/2 Yii Framework/1.1.6