PHP notice

Undefined offset: 20

/home/u439419125/domains/events.az/private_html/conf/common/models/Events.php(820)

808         
809         return $this;
810     }
811     
812     public function getSlug()
813     {
814         return ( !empty($this->{'slug_'.Yii::app()->language}) ) ? $this->{'slug_'.Yii::app()->language} : $this->{'title_'.Yii::app()->language};
815     }
816     
817     public function getColor($index = 0)
818     {
819         $colors = $this->colors;
820         return $colors[$index][rand(0, count($colors[$index]) - 1)];
821     }
822     
823     public function getFullDate($time = 'start_time')
824     {
825         $day = date('d', $this->$time);
826         $month = Yii::app()->MY->getMonthNameForLang( date('m', $this->$time) );
827         $year = date('Y', $this->$time);
828         $week = date('w', $this->$time);
829         
830         return $day.' '.$month.' '.$year.', '.Yii::t('main', 'week0'.$week);
831     }
832     

Stack Trace

#0
+
 /home/u439419125/domains/events.az/private_html/conf/common/widgets/views/placesgelecekevents.php(7): Events->getColor(20)
02     <!-- New-event start -->
03     <section id="new-events">
04         <div class="container">
05             <div class="count-desc">
06             <?php foreach( $model as $i=>$e ): $file = $e->eventsFiles(array('limit'=>1, 'order'=>'id DESC', 'scopes'=>'images')); if(count($file)): ?>
07                 <?php $bgColor = $e->getColor($i); ?>
08                 <div class="col-lg-2 col-md-2 col-sm-2 col-xs-12">
09                     <div class="new-e">
10                         <a href="<?=Yii::app()->createUrl('events/'.$e->id, array('slug'=>$e->getSlug()))?>">
11                             <img src="<?=$file[0]->getImageUrl('main')?>">
12                             <div class="new-title">
#4
+
 /home/u439419125/domains/events.az/private_html/conf/common/widgets/PlacesGelecekEvents.php(22): CWidget->render("placesgelecekevents", array("model" => array(Events, Events, Events, Events, ...), "title" => false))
17                  $model = $this->model;
18             
19             $this->render($this->renderFile, array(
20                 'model'=>$model, 
21                 'title'=>( is_null($this->model) ) ? true : false
22             ));
23         }
24     }
25     
26 ?>
#6
+
 /home/u439419125/domains/events.az/private_html/conf/frontend/protected/views/site/more/mplaces.php(87): CBaseController->widget("common.widgets.PlacesGelecekEvents", array("model" => array(Events, Events, Events, Events, ...)))
82                 <div class="col-md-12">
83                 <div class="tab-content" id="new-events">
84                     <section class="tab-pane fade in active" id="yaxin">
85                         <div class="count-desc">
86                             <?php if( count($events) > 0 ): ?>
87                             <?php $this->widget('common.widgets.PlacesGelecekEvents', array('model'=>$events)); ?>
88                             <?php endif; ?>
89                         </div>
90                     </section>
91                     <? /* 
92                     <section class="tab-pane fade" id="pulsuz">
2024-03-19 10:31:10 LiteSpeed Yii Framework/1.1.13