PHP Error

Undefined offset: 0

/home/vlcgroup/public_html/protected/models/Newstrans.php(153)

141         return self::model()->with('news', 'news.cat', 'language')->findAll(array(
142         'condition' => 'news.active = 1 AND news.home = 1 AND cat.menu_id = ' . $menu_id . ' AND language.code like "' . Yii::app()->session['lang'] . '"',
143         'order' => 'cat.ord ASC, t.id DESC',
144         'limit' => 6
145         ));
146     }
147     
148     public function getNewsById($id)
149     {
150         $result = self::model()->with('news', 'language')->findAll(array(
151         'condition' => 'news.active = 1 AND news_id = ' . $id . ' AND language.code like "' . Yii::app()->session['lang'] . '"',
152         ));
153         return $result[0];
154     }
155     
156     public function getOrtherByCat($news_id, $cat_id)
157     {
158         $result = self::model()->with('news', 'language')->findAll(array(
159         'condition' => 'news.active = 1 AND news.id < ' . $news_id . ' AND news.cat_id = ' . $cat_id . ' AND language.code like "' . Yii::app()->session['lang'] . '"',
160         'order' => 't.id DESC',
161         'limit' => 4
162         ));
163         return $result;
164     }
165     

Stack Trace

#0
+
 /home/vlcgroup/public_html/protected/controllers/SiteController.php(228): Newstrans->getNewsById("110")
223         else 
224         {
225             Yii::app()->language = Yii::app()->session['lang'];
226         }
227         
228         $model = Newstrans::getNewsById($id);
229         
230         if ($model)
231         {
232             $menu = Menutrans::showMenu($model->news->cat->menu_id);
233             if ($menu)
#10
+
 /home/vlcgroup/public_html/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 22:18:31 LiteSpeed Yii Framework/1.1.7