PHP warning

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

/home4/journfp8/public_html/yii-1.1.14.f0fee9/framework/db/ar/CActiveFinder.php(587)

575                     break;
576                 }
577             }
578 
579             if(!$fkDefined)
580             {
581                 $parentCondition=array();
582                 $childCondition=array();
583                 $count=0;
584                 $params=array();
585                 foreach($fks as $i=>$fk)
586                 {
587                     if($i<count($parent->_table->primaryKey))
588                     {
589                         $pk=is_array($parent->_table->primaryKey) ? $parent->_table->primaryKey[$i] : $parent->_table->primaryKey;
590                         $parentCondition[$pk]=$joinAlias.'.'.$schema->quoteColumnName($fk).'=:ypl'.$count;
591                         $params[':ypl'.$count]=$record->$pk;
592                         $count++;
593                     }
594                     else
595                     {
596                         $j=$i-count($parent->_table->primaryKey);
597                         $pk=is_array($this->_table->primaryKey) ? $this->_table->primaryKey[$j] : $this->_table->primaryKey;
598                         $childCondition[$pk]=$this->getColumnPrefix().$schema->quoteColumnName($pk).'='.$joinAlias.'.'.$schema->quoteColumnName($fk);
599                     }

Stack Trace

#4
+
 /home4/journfp8/public_html/admin/backend/protected/extensions/JI18nActiveRecord.php(39): CActiveRecord->__get("journeies")
34 
35     public function __get($name) {
36         if(array_key_exists($name,$this->_i18nAttributes))
37         return $this->_i18nAttributes[$name];
38         else
39         return parent::__get($name);
40     }
41 
42     public function __set($name,$value) {
43         if(array_key_exists($name,$this->_i18nAttributes))
44         $this->_i18nAttributes[$name]=$value;
#5
+
 /home4/journfp8/public_html/protected/controllers/FanController.php(133): JI18nActiveRecord->__get("journeies")
128 
129         // Related journey
130         // $journeyShareSubject = urlencode(mb_convert_encoding(Setting::getValueByCode('journey_share_subject', true), 'GBK', 'UTF-8'));
131         $journeyShareSubject = Setting::getValueByCode('journey_share_subject', true);
132 
133         $journeyIdList = CHtml::listData($fan->journeies, 'journey_id', 'journey_id');
134         // $criteria = new CDbCriteria();
135         // $criteria->addInCondition('journey_id', $journeyIdList);
136         // $criteria->order = 't.sort_order DESC, t.journey_id DESC';
137         // $journeys = Journey::model()->localized()->findAll($criteria);
138         $criteria = new CDbCriteria();
#13
+
 /home4/journfp8/public_html/index.php(16): CApplication->run()
11     ini_set('display_errors', 'On');
12     error_reporting(E_ALL | E_STRICT);
13 }
14 
15 require_once($yii);
16 Yii::createWebApplication($config)->run();
17 
18 ?>
2024-03-19 10:17:29 Apache Yii Framework/1.1.14