PHP warning

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

/home/u497568/old.okostyle.spb.ru/www/yii/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
+
 /home/u497568/old.okostyle.spb.ru/www/protected/models/Article.php(298): CActiveRecord->__get("categories")
293     }
294     
295     public function getCategoryAliases() {
296         $out = array();
297         
298         foreach ($this->categories as $category) {
299             $out[] = $category->alias;
300         }
301         return $out;
302     }
303     
#5
+
 /home/u497568/old.okostyle.spb.ru/www/protected/controllers/CategoryController.php(97): Article->getCategoryAliases()
092         $this->render('view',array(
093             'category'=>$category,
094             'shares'=>$shares,
095             'models'=>$models,
096             'pages'=>$pages,
097             'categories' => $article->getCategoryAliases(),
098         ));
099     }
100     
101     private $_model;
102     private $_model2;
#18
+
 /home/u497568/old.okostyle.spb.ru/www/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 18:11:56 Apache Yii Framework/1.1.14