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/views/article/_item_search.php(7): Article->getAuthors()
02     <h3 class="title title_article-tizer"><a
03                 href="<?php echo Yii::app()->createUrl('author/article/view', array('id' => $data['url'])); ?>"><?php echo $data['title']; ?> </a>
04     </h3>
05 
06     <div class="article-tizer-authors">
07         <?php $a = $data->getAuthors();
08         foreach ($a as $author): ?>
09             <span class="icon icon_person"></span>
10             <a class="link"
11                href="<?php echo Yii::app()->createUrl('author/profile/view', array('id' => $author['id'])); ?>"><?= $author['name'] ?></a>
12             <?php
#14
+
 /home/tvertop/swsys-web.ru/docs/protected/modules/author/views/article/search.php(24): CBaseController->widget("zii.widgets.CListView", array("dataProvider" => CArrayDataProvider, "itemView" => "_item_search", "template" => "{items}{pager}", "itemsTagName" => "ol", ...))
19             'itemsCssClass' => '',
20             'emptyText' => Yii::t('journal', 'There are no articles for this request'),
21             'pagerCssClass' => 'center',
22             'pager' => array('class' => 'bootstrap.widgets.TbPager'),
23             'viewData' => array('hits' => (isset($hits))?$hits : array(), 'previews' => $previews)
24         ));
25     }?>
26 </div>
27 
28 <style>
29     ol {
2024-03-29 11:11:57 Apache/2.4.53 (Red Hat Enterprise Linux 8) PHP/5.4.45 Yii Framework/1.1.13