CDbException

The table "tb_promo_ongkir" for active record class "PromoOngkir" cannot be found in the database.

/home/suryasukses/yii/framework/db/ar/CActiveRecord.php(2312)

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

Stack Trace

#1
+
 /home/suryasukses/public_html/amariupvc.com/protected/models/PromoOngkir.php(23): CActiveRecord::model("PromoOngkir")
18      * @param string $className active record class name.
19      * @return PromoOngkir the static model class
20      */
21     public static function model($className=__CLASS__)
22     {
23         return parent::model($className);
24     }
25 
26     /**
27      * @return string the associated database table name
28      */
#2
+
 /home/suryasukses/public_html/amariupvc.com/protected/components/Promote_ongkir.php(16): PromoOngkir::model()
11 
12         $id_product = intval($id_product);
13         $id_pr = intval(1);
14 
15         // checking promo bila aktif
16         $gPromod = PromoOngkir::model()->find('id = :id AND status = 1', array(':id'=>$id_pr));
17         if ($gPromod->status == '1') {
18             // get all promotion products
19             $prm_ongkir = PromoOngkirProduct::model()->find('id_promo = :id_promo AND id_product = :id_product', array(
20                 ':id_promo'=> $gPromod->id,
21                 ':id_product'=> $id_product,
#3
+
 /home/suryasukses/public_html/amariupvc.com/protected/views/product/index.php(60): Promote_ongkir::promote("2")
55                 </script>
56 
57                 <div id="list-products" class="row">
58             
59                     <?php foreach ($product->getData() as $key => $value): ?>
60                         <?php $get_prm_ongkir = Promote_ongkir::promote($value->id); ?>
61                             <div class="col-md-4 col-sm-6 products">                        
62                             <?php /*
63                             <?php if( $key == 4 || $key == 2 || $key == 0 ) : ?>
64                             <?php endif ?>
65                             */ ?>
2021-07-26 11:01:21 Apache Yii Framework/1.1.12