CDbException

Таблица "tbl_post", упомянутая в записи active record класса "Post", не найдена в базе данных.

/home/users/h/hamsterman/domains/hamsterman.ru/protected/framework/db/ar/CActiveRecord.php(2264)

2252     private $_model;
2253 
2254     /**
2255      * Constructor.
2256      * @param CActiveRecord $model the model instance
2257      */
2258     public function __construct($model)
2259     {
2260         $this->_model=$model;
2261 
2262         $tableName=$model->tableName();
2263         if(($table=$model->getDbConnection()->getSchema()->getTable($tableName))===null)
2264             throw new CDbException(Yii::t('yii','The table "{table}" for active record class "{class}" cannot be found in the database.',
2265                 array('{class}'=>get_class($model),'{table}'=>$tableName)));
2266         if($table->primaryKey===null)
2267         {
2268             $table->primaryKey=$model->primaryKey();
2269             if(is_string($table->primaryKey) && isset($table->columns[$table->primaryKey]))
2270                 $table->columns[$table->primaryKey]->isPrimaryKey=true;
2271             else if(is_array($table->primaryKey))
2272             {
2273                 foreach($table->primaryKey as $name)
2274                 {
2275                     if(isset($table->columns[$name]))
2276                         $table->columns[$name]->isPrimaryKey=true;

Stack Trace

#1
+
 /home/users/h/hamsterman/domains/hamsterman.ru/protected/models/Post.php(28): CActiveRecord::model("Post")
23      * Returns the static model of the specified AR class.
24      * @return CActiveRecord the static model class
25      */
26     public static function model($className=__CLASS__)
27     {
28         return parent::model($className);
29     }
30 
31     /**
32      * @return string the associated database table name
33      */
#2
+
 /home/users/h/hamsterman/domains/hamsterman.ru/protected/controllers/BlogController.php(185): Post::model()
180             {
181                 if(Yii::app()->user->isGuest)
182                     $condition='status='.Post::STATUS_PUBLISHED.' OR status='.Post::STATUS_ARCHIVED;
183                 else
184                     $condition='';
185                 $this->_model=Post::model()->findByPk($_GET['id'], $condition);
186             }
187             if($this->_model===null)
188                 throw new CHttpException(404,'Страница не найдена.');
189         }
190         return $this->_model;
#3
+
 /home/users/h/hamsterman/domains/hamsterman.ru/protected/controllers/BlogController.php(48): BlogController->loadModel()
43     /**
44      * Displays a particular model.
45      */
46     public function actionView()
47     {
48         $post=$this->loadModel();
49         $comment=$this->newComment($post);
50 
51         $this->render('view',array(
52             'model'=>$post,
53             'comment'=>$comment,
2024-03-28 22:14:54 Apache Yii Framework/1.1.10