PHP notice

Trying to get property of non-object

/var/www/html/site.autobest_current/protected/views/site/pages/comparador.php(400)

388                         $ids = $autos;
389                         if(count($autos) > 0){
390                             foreach($autos as $id){
391                                 $a = Producto::model()->findByPk($id);
392                                 if($a != NULL){
393                                     if($a->modelo0 != NULL && $a->modelo0->ruta_nav != ""){
394                                         $rutaImg = $a->modelo0->ruta_nav;
395                                     }else{
396                                         $rutaImg = AMTMainImage::mainImage($a->id, "Producto", array(), false, 0, false, array("style"=>"position:relative;", "class"=>"imgCont"), true); 
397                                     }
398                                     $matchesTxt[$m->categoria] .= '<div class="matchInfo">
399                                         <a href="'.$this->createUrl("Carrito/Comparar", array("c"=>implode(",", $ids))).'" target="_blank" class="fancyFrame">
400                                             <h5 class="text-center text-muted"><span class="resaltado2">'.$a->marca0->marca.' '.$a->modelo0->modelo.'</span><br /><small>'.$a->submodelo0->submodelo.'</small></h5>
401                                             <img src="'.$rutaImg.'" /><br />
402                                             <p class="text-danger text-center">$'.number_format($a->productoFormaVentas[0]->precio_directo).' <small>'.$a->productoFormaVentas[0]->moneda.'</small></p>
403                                         </a>
404                                     </div>';
405                                 }
406                             }
407                         }
408                         /*$matchesTxt[$m->categoria] .= '<!--<div class="matchInfo" style="width:'.(100 / (count($autos) + 1)).'%;">
409                             <a href="'.$this->createUrl("Carrito/Comparar", array("c"=>implode(",", $ids))).'" target="_blank" class="fancyFrame">
410                                 <!--<h5 style="font-weight:300; margin:0px; line-height:18px; height:36px; font-size:14px; overflow:hidden; word-wrap:break-word;" class="text-center text-muted"><span class="resaltado2">Ver Match</span></h5>-->
411                                 <img src="/images/toolbar/icons/addCar.jpg" />
412                             </a>

Stack Trace

#12
+
 /var/www/html/site.autobest_current/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 01:35:08 Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/5.6.40 Yii Framework/1.1.13