本文整理汇总了PHP中app\models\Tag::className方法的典型用法代码示例。如果您正苦于以下问题:PHP Tag::className方法的具体用法?PHP Tag::className怎么用?PHP Tag::className使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\models\Tag
的用法示例。
在下文中一共展示了Tag::className方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getTag
public function getTag()
{
return $this->hasOne(Tag::className(), ['tid' => 'id']);
}
示例2: getTag
public function getTag()
{
return $this->hasOne(Tag::className(), ['id' => 'tag_id'])->select(['id', 'name']);
}
示例3: getTags
public function getTags()
{
return $this->hasMany(Tag::className(), ['id' => 'tag_id'])->viaTable(TagTopic::tableName(), ['topic_id' => 'id']);
}
示例4: getPersonalTags
public function getPersonalTags()
{
return $this->hasMany(Tag::className(), ['id' => 'tag_id'])->personalTags()->viaTable('partner_tag', ['partner_id' => 'id']);
}
示例5: getTags
/**
* @return \yii\db\ActiveQuery
*/
public function getTags()
{
return $this->hasMany(Tag::className(), ['id' => 'tag_id'])->viaTable('artist_tag', ['artist_id' => 'id']);
}
示例6: getTags
public function getTags()
{
return $this->hasMany(Tag::className(), ['id' => 'tagId'])->viaTable('image_tag', ['imageId' => 'id']);
}
示例7: getBookTags
/**
* @return \yii\db\ActiveQuery
*/
public function getBookTags()
{
return $this->hasMany(Tag::className(), ['id' => 'tagId'])->viaTable('book_tag', ['bookId' => 'id']);
}
示例8: getTags
/**
* @return \yii\db\ActiveQuery
*/
public function getTags()
{
return $this->hasMany(Tag::className(), ['user_id' => 'id']);
}
示例9: getTag0
/**
* @return \yii\db\ActiveQuery
*/
public function getTag0()
{
return $this->hasOne(Tag::className(), ['tag_id' => 'tag']);
}
示例10: getTags
/**
* 获取帖子标签(关联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]);
});
}