PHP warning

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

/var/www/html/scarpatti/protected/models/Producto/Producto.php(81)

69             $this->videos = null;
70             $this->volumen = null;
71             $this->etiquetasxProducto = NULL;
72         }
73         catch(Exception $e){
74             Sawubona::writeLog($e);
75         }
76     }
77 
78     //    Imprime las imagenes del producto
79     public function printImagenes($xLimit = 1, $xClass = '', $xContainer = false, $xCondition = null, $xBool = true, $xDefault = 'producto.jpg'){
80         try{
81             $xCount = count($this->imagenes);
82             $xLimit = (is_numeric($xLimit)) ? $xLimit : null;
83             $xCondition = (is_string($xCondition)) ? $xCondition : '';
84             $xBool = (is_bool($xBool)) ? $xBool : true;
85             $xOffSet = 0;
86 
87             if(is_array($this->imagenes) && $xCount > 0){
88                 for($i = 0; $i < $xCount; $i++){
89                     if($this->imagenes[$i] instanceof Imagen){
90                         if($xCondition != ''){
91                             if($xBool && $this->imagenes[$i]->nombre == $xCondition){
92                                 $this->imagenes[$i]->printImagen($xClass, $xContainer, $this->titulo);
93                                 $xOffSet ++;

Stack Trace

#0
+
 /var/www/html/scarpatti/protected/views/productos/producto-ampliado.php(20): Producto->printImagenes(1)
15    <div class="container indicators prod-ampliado">
16       <div id="carousel-fabrica" class="carousel carousel-responsive slide carousel-fabrica " data-ride="carousel" data-items="2, 2, 3, 3">
17          <div class="carousel-inner" role="listbox">
18 
19              <?php if (empty($oProducto->imagenes)) {
20                      $oProducto->printImagenes(1);
21                    } 
22             else {
23              foreach($oProducto->imagenes as $i => $Pimg){?>
24             <div class="item">
25                <a href="#" data-boton="<?php echo $Pimg->idImagen;?>"><img src="<?php echo $Pimg->path;?>" alt="..."> </a>
#5
+
 /var/www/html/scarpatti/protected/controllers/default/Productos.php(91): CController->render("/productos/producto-ampliado", array("oProducto" => Producto, "Relacionados" => array(Producto, Producto, Producto, Producto, ...)))
86         $Parametros = array(
87             'oProducto'    => $oProducto,
88             'Relacionados' => $Relacionados
89         );
90 
91         $this->render("/productos/producto-ampliado",$Parametros);
92     }
93     //*end-action*//
94 }
95 ?>
#6
+
 /var/www/html/scarpatti/protected/controllers/es/ProductosController.php(12): Productos->productoAmpliado()
07     }
08     //*end-action*//
09 
10     //*start-action*//
11     public function actionProductoAmpliado(){
12         $this->productoAmpliado();
13     }
14     //*end-action*//
15 }
16 ?>
2024-03-29 11:06:16 Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.3.5 Yii Framework/1.1.15