PHP notice

Trying to get property 'familyID' of non-object

/home/birdcom/domains/birdwatchingvietnam.net/public_html/protected/controllers/BirddetailController.php(22)

10         $bird = Bird::model()->findByPk($param);
11         $birdimage = Birdimages::model()->findAll('birdID='.$param . ' order by mainpicture desc');
12         $birdsound = Birdsound::model()->findAll('birdID='.$param);
13         
14         switch ($searchby) {
15             case 'english-name':
16                 $birdsbyfamily = Bird::model()->findAll('birdID<>' . $param . ' and familyID='.$bird->familyID . ' order by datasort');
17                 break;
18             case 'science-name':
19                 $birdsbyfamily = Bird::model()->findAll('birdID<>' . $param . ' and familyID='.$bird->familyID . ' order by datasort');
20                 break;
21             case 'vietnamese-name':
22                 $birdsbyfamily = Bird::model()->findAll('birdID<>' . $param . ' and familyID='.$bird->familyID . ' order by datasort');
23                 break;
24             default:
25                 $birdsbyfamily = Bird::model()->findAll('birdID<>' . $param . ' and familyID='.$bird->familyID . ' order by datasort');
26                 break;
27         }
28         
29         $familybybird = Family::model()->find('familyID='. $bird->familyID);
30         $orderbyfamily = Orders::model()->find('ordersID='. $familybybird->ordersID);
31         // Distribution
32         $ids_countries = $bird->listcountries;
33         if($ids_countries != '') {
34             $ids_countries = trim($ids_countries, ' ');

Stack Trace

#7
+
 /home/birdcom/domains/birdwatchingvietnam.net/public_html/index.php(12): CApplication->run()
07 defined('YII_DEBUG') or define('YII_DEBUG',true);
08 // specify how many levels of call stack should be shown in each log message
09 //defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
10 require_once($yii);
11 
12 Yii::createWebApplication($config)->run();
13 
14 
2024-03-29 22:36:30 Apache/2 Yii Framework/1.1.13