CDbException

The table "annonce" for active record class "Annonce" cannot be found in the database.

/home/zikbay/public_html/yii-1.1.7.r3135/framework/db/ar/CActiveRecord.php(2237)

2225     private $_model;
2226 
2227     /**
2228      * Constructor.
2229      * @param CActiveRecord $model the model instance
2230      */
2231     public function __construct($model)
2232     {
2233         $this->_model=$model;
2234 
2235         $tableName=$model->tableName();
2236         if(($table=$model->getDbConnection()->getSchema()->getTable($tableName))===null)
2237             throw new CDbException(Yii::t('yii','The table "{table}" for active record class "{class}" cannot be found in the database.',
2238                 array('{class}'=>get_class($model),'{table}'=>$tableName)));
2239         if($table->primaryKey===null)
2240             $table->primaryKey=$model->primaryKey();
2241         $this->tableSchema=$table;
2242         $this->columns=$table->columns;
2243 
2244         foreach($table->columns as $name=>$column)
2245         {
2246             if(!$column->isPrimaryKey && $column->defaultValue!==null)
2247                 $this->attributeDefaults[$name]=$column->defaultValue;
2248         }
2249 

Stack Trace

#1
+
 /home/zikbay/public_html/protected/modules/Ads/models/base/AnnonceBase.php(52): CActiveRecord::model("Annonce")
47      * Returns the static model of the specified AR class.
48      * @return Annonce the static model class
49      */
50     public static function model($className='Annonce')
51     {
52         return parent::model($className);
53     }
54 
55     /**
56      * @return string the associated database table name
57      */
#2
+
 /home/zikbay/public_html/protected/modules/Ads/controllers/AdController.php(639): AnnonceBase::model()
634 
635         elseif (Yii::app()->user->isGuest)
636 
637         {
638 
639             if (Annonce::model()->validateEmailAndClientIP('')==FALSE)
640 
641                 throw new CHttpException(400,UserSettings::MSG_BANNED_USER);    
642 
643         }
644 
#10
+
 /home/zikbay/public_html/index.php(25): CApplication->run()
20     )
21 {
22     require_once(dirname(__FILE__).'/protected/modules/install/install.php');
23 }else{
24     require_once($yii);
25     Yii::createWebApplication($config)->run();
26 }
2021-04-21 13:07:00 Apache/2.4.39 (Unix) OpenSSL/1.0.2k-fips Yii Framework/1.1.7