CDbException

Relation "country" is not defined in active record class "Profile".

/home/tvertop/swsys-web.ru/docs/framework/db/ar/CActiveFinder.php(211)

199             // named scope
200             $scopes=array();
201             if(($pos=strpos($with,':'))!==false)
202             {
203                 $scopes=explode(':',substr($with,$pos+1));
204                 $with=substr($with,0,$pos);
205             }
206 
207             if(isset($parent->children[$with]) && $parent->children[$with]->master===null)
208                 return $parent->children[$with];
209 
210             if(($relation=$parent->model->getActiveRelation($with))===null)
211                 throw new CDbException(Yii::t('yii','Relation "{name}" is not defined in active record class "{class}".',
212                     array('{class}'=>get_class($parent->model), '{name}'=>$with)));
213 
214             $relation=clone $relation;
215             $model=CActiveRecord::model($relation->className);
216 
217             if($relation instanceof CActiveRelation)
218             {
219                 $oldAlias=$model->getTableAlias(false,false);
220                 if(isset($options['alias']))
221                     $model->setTableAlias($options['alias']);
222                 elseif($relation->alias===null)
223                     $model->setTableAlias($relation->name);

Stack Trace

#4
+
 /home/tvertop/swsys-web.ru/docs/protected/modules/author/models/Article.php(233): CActiveRecord->find(CDbCriteria)
228         if ($this->advanced->is_author == 1) {
229             $criteria = new CDbCriteria();
230             $criteria->condition = '`user_id` = :id';
231             $criteria->params = array(':id' => $this->author);
232 
233             $author = Profile::model()->with('country')->find($criteria);
234             $relations = array_merge(array($author), $relations);
235         }
236 
237         foreach ($relations as $one) {
238             $criteria = new CDbCriteria();
#5
+
 /home/tvertop/swsys-web.ru/docs/protected/modules/author/controllers/ArticleController.php(99): Article->getAuthors()
094 
095             $model = $this->loadModel($id);
096             $modelTranslated = $model->getTranslation(Language::getCurrentID());
097 
098             // Getting information about authors
099             $authors = $modelTranslated->getAuthors();
100 
101             // Getting tags
102             $tags_array = $modelTranslated->getTags();
103 
104             // Loading aditional information
#6
+
 /home/tvertop/swsys-web.ru/docs/protected/modules/author/controllers/ArticleController.php(160): ArticleController->loadData("206")
155      * Displays a particular model.
156      * @param integer $id the ID of the model to be displayed
157      */
158     public function actionView($id)
159     {
160         $article = $this->loadData($id);
161 
162         $document = new DOMDocument();
163         $articleContent = $article['model']->content ? $article['model']->content : $article['modelOriginal']->content;
164         $document->loadHTML('<meta http-equiv="content-type" content="text/html; charset=utf-8">' . $articleContent);
165 
2024-03-28 13:42:31 Apache/2.4.53 (Red Hat Enterprise Linux 8) PHP/5.4.45 Yii Framework/1.1.13