Example #1
0
 public function getTag()
 {
     return $this->hasOne(Tag::className(), ['tid' => 'id']);
 }
Example #2
0
 public function getTag()
 {
     return $this->hasOne(Tag::className(), ['id' => 'tag_id'])->select(['id', 'name']);
 }
Example #3
0
 public function getTags()
 {
     return $this->hasMany(Tag::className(), ['id' => 'tag_id'])->viaTable(TagTopic::tableName(), ['topic_id' => 'id']);
 }
Example #4
0
 public function getPersonalTags()
 {
     return $this->hasMany(Tag::className(), ['id' => 'tag_id'])->personalTags()->viaTable('partner_tag', ['partner_id' => 'id']);
 }
Example #5
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getTags()
 {
     return $this->hasMany(Tag::className(), ['id' => 'tag_id'])->viaTable('artist_tag', ['artist_id' => 'id']);
 }
Example #6
0
 public function getTags()
 {
     return $this->hasMany(Tag::className(), ['id' => 'tagId'])->viaTable('image_tag', ['imageId' => 'id']);
 }
Example #7
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getBookTags()
 {
     return $this->hasMany(Tag::className(), ['id' => 'tagId'])->viaTable('book_tag', ['bookId' => 'id']);
 }
Example #8
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getTags()
 {
     return $this->hasMany(Tag::className(), ['user_id' => 'id']);
 }
Example #9
0
 public function getTags()
 {
     return $this->hasMany(Tag::className(), ['id' => 'tag_id'])->viaTable('threads_tags', ['thread_id' => 'id']);
 }
Example #10
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getTag0()
 {
     return $this->hasOne(Tag::className(), ['tag_id' => 'tag']);
 }
Example #11
0
 /**
  * 获取帖子标签(关联tag_item表)
  * @return mixed
  */
 public function getTags()
 {
     return $this->hasMany(Tag::className(), ['id' => 'tid'])->viaTable(TagItem::tableName(), ['target_id' => 'id'], function ($model) {
         $model->andWhere(['target_type' => static::TYPE]);
     });
 }