PHP notice

Trying to get property 's_first_image' of non-object

/var/www/webs/cruiserracer/html/protected/controllers/AdminController.php(431)

419         //$model = TblBoat::model()->with('design','dimensions','engines','tankage','galley','instruments','electrical','rigging','deck','safety','construction','accomodations','extra')->findByPk($id);
420 
421            $modelA = TblBoat::model()->with('design','dimensions','engines')->findByPk($id);
422            $modelB = TblBoat::model()->with('tankage','galley','instruments')->findByPk($id);
423            $modelC = TblBoat::model()->with('electrical','rigging','deck')->findByPk($id);
424            $modelD = TblBoat::model()->with('safety','construction')->findByPk($id);
425            $modelE = TblBoat::model()->with('accomodations','extra')->findByPk($id);
426 
427            /*if(yii::app()->user->getState('role') == 0 && $modelA->user_id != yii::app()->user->getId()) {
428             $this->redirect(array('admin/list'));
429        }*/
430         $urlFullImage = Yii::app()->request->baseUrl . Yii::app()->params['fullImageUrl'] ;
431         $image = ($modelA->s_first_image !== null) ? $modelA->s_first_image : $modelA->ship_id . '.jpg'; 
432 
433         $attributes = $modelA->attributes;
434         $pdf = Yii::createComponent('application.extensions.tcpdf.ETcPdf',
435                                     'P', 'mm', 'A4', true, 'UTF-8');
436         $pdf->SetCreator(PDF_CREATOR);
437         $pdf->SetAuthor("Cruiser-Racer");
438         $pdf->SetTitle($attributes['name']);
439         $pdf->SetSubject("Cruiser-Racer Boat");
440         $pdf->SetKeywords("boat brokerage, boat charter, cruiser racer boats");
441         $pdf->setPrintHeader(true);
442         $pdf->setPrintFooter(true);
443         $pdf->SetMargins(20, 20, 20);

Stack Trace

#14
+
 /var/www/webs/cruiserracer/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-28 19:40:35 Apache/2.4.37 (centos) OpenSSL/1.1.1g PHP/7.2.24 Yii Framework/1.1.12