Tag::tableName PHP Method

tableName() public method

public tableName ( ) : string
return string the associated database table name
    public function tableName()
    {
        return '{{blog_tag}}';
    }

Usage Example

示例#1
0
文件: Article.php 项目: oakcms/oakcms
 public function api_items($options = [])
 {
     if (!$this->_items) {
         $this->_items = [];
         $query = ContentArticles::find()->with('translations')->status(ContentArticles::STATUS_PUBLISHED);
         if (!empty($options['where'])) {
             $query->andFilterWhere($options['where']);
         }
         if (!empty($options['tags'])) {
             $query->innerJoinWith('tags', false)->andWhere([Tag::tableName() . '.name' => (new Item())->filterTagValues($options['tags'])])->addGroupBy('item_id');
         }
         if (!empty($options['orderBy'])) {
             $query->orderBy($options['orderBy']);
         } else {
             $query->sortDate();
         }
         $this->_adp = new ActiveDataProvider(['query' => $query, 'pagination' => !empty($options['pagination']) ? $options['pagination'] : []]);
         foreach ($this->_adp->models as $model) {
             $this->_items[] = new ArticleObject($model);
         }
     }
     return $this->_items;
 }
All Usage Examples Of Tag::tableName