PHP notice

Trying to get property 'is_archived' of non-object

/var/www/lava-brands.com/html/protected/controllers/WorkbyprojectController.php(59)

47 
48     /**
49      * Displays a particular model.
50      * @param integer $id the ID of the model to be displayed
51      */
52     public function actionView($slug)
53     {
54         $this->layout = "//layouts/main";
55         if (is_numeric($slug))
56             throw new CHttpException(404, 'The requested page does not exist.');
57         $model = Workbyproject::model()->findByAttributes(array('slug' => $slug));
58 
59         if ($model->is_archived)
60             $this->render('view_archive', array('model' => $model));
61         else
62             $this->render('view', array('model' => $model));
63 
64     }
65 
66     /**
67      * Creates a new model.
68      * If creation is successful, the browser will be redirected to the 'view' page.
69      */
70     public function actionCreate()
71     {

Stack Trace

#14
+
 /var/www/lava-brands.com/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 13:08:07 Apache/2.4.29 (Ubuntu) Yii Framework/1.1.15