CDbException

The table "{{product_category_videos}}" for active record class "ProductCategoryVideo" cannot be found in the database.

/data/www/public_html/tranhgom/common/lib/framework/db/ar/CActiveRecord.php(2310)

2298     private $_model;
2299 
2300     /**
2301      * Constructor.
2302      * @param CActiveRecord $model the model instance
2303      */
2304     public function __construct($model)
2305     {
2306         $this->_model=$model;
2307 
2308         $tableName=$model->tableName();
2309         if(($table=$model->getDbConnection()->getSchema()->getTable($tableName))===null)
2310             throw new CDbException(Yii::t('yii','The table "{table}" for active record class "{class}" cannot be found in the database.',
2311                 array('{class}'=>get_class($model),'{table}'=>$tableName)));
2312         if($table->primaryKey===null)
2313         {
2314             $table->primaryKey=$model->primaryKey();
2315             if(is_string($table->primaryKey) && isset($table->columns[$table->primaryKey]))
2316                 $table->columns[$table->primaryKey]->isPrimaryKey=true;
2317             elseif(is_array($table->primaryKey))
2318             {
2319                 foreach($table->primaryKey as $name)
2320                 {
2321                     if(isset($table->columns[$name]))
2322                         $table->columns[$name]->isPrimaryKey=true;

Stack Trace

#1
+
 /data/www/public_html/tranhgom/common/models/ProductCategoryVideo.php(16): CActiveRecord::model("ProductCategoryVideo")
11   // Status
12   const STATUS_SHOW = 1;
13   const STATUS_HIDE = 0;
14 
15   public static function model($className = __CLASS__) {
16     return parent::model($className);
17   }
18 
19   public function tableName() {
20     return '{{product_category_videos}}';
21   }
#2
+
 /data/www/public_html/tranhgom/frontend/protected/controllers/ProductController.php(153): ProductCategoryVideo::model()
148     $type = $productCategory->type;
149     $style='';
150     //Breadcums
151     $title = $productCategory->title;
152     $this->breadcrumbs = array($productCategory->title => $productCategory->getUrlDetail(), $model->title);
153     $videos =  ProductCategoryVideo::model()->findAll("status = 1 and productCategoryId = '".$productCategory->id."' ORDER BY sort");
154     $criteria = new CDbCriteria;
155     $criteria->addCondition('status = :status');
156     $criteria->params['status'] = Product::STATUS_SHOW;
157     $criteria->addCondition('type = :type');
158     $criteria->params['type'] = $type;
#12
+
 /data/www/public_html/tranhgom/index.php(18): CApplication->run()
13 
14 require_once($yii);
15 require_once($global);
16 require_once($define);
17 
18 Yii::createWebApplication($config)->run();
2024-03-28 15:46:57 nginx/1.13.9 Yii Framework/1.1.13