コード例 #1
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getPost()
 {
     return $this->hasOne(Post::className(), ['id' => 'post_id']);
 }
コード例 #2
0
ファイル: Term.php プロジェクト: sunjie20081001/gudaotu-yii2
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getPosts()
 {
     return $this->hasMany(Post::className(), ['term_id' => 'id']);
 }
コード例 #3
0
ファイル: Category.php プロジェクト: stanislavdev1993/blog
 public function getPosts()
 {
     return $this->hasMany(Post::className(), ['id' => 'post_id'])->viaTable('post_category', ['category_id' => 'id']);
 }
コード例 #4
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getPosts()
 {
     return $this->hasMany(Post::className(), ['owner' => 'formalemail']);
 }
コード例 #5
0
ファイル: Tag.php プロジェクト: mamontovdmitriy/aaaaa
 public function getPosts()
 {
     return $this->hasMany(Post::className(), ['id' => 'post_id'])->viaTable('tag4post', ['tag_id' => 'id']);
 }
コード例 #6
0
ファイル: Profile.php プロジェクト: playdayteam/jdocgen
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getPosts()
 {
     return $this->hasMany(Post::className(), ['agg_author_profile_id' => 'id']);
 }
コード例 #7
0
ファイル: User.php プロジェクト: heartshare/yii2-crazydb-blog
 public function getAllPosts()
 {
     return $this->hasMany(Post::className(), ['author_id' => 'id'])->orderBy(['is_top' => SORT_DESC, 'post_time' => SORT_DESC]);
 }
コード例 #8
0
ファイル: PostCategory.php プロジェクト: phucnv206/pharma
 public function getPosts()
 {
     return $this->hasMany(Post::className(), ['cate_id' => 'id'])->asArray();
 }
コード例 #9
0
 /**
  * Invalidate model tags.
  * @return bool
  */
 public function invalidateTags()
 {
     /** @var \DevGroup\TagDependencyHelper\TagDependencyTrait $this */
     \yii\caching\TagDependency::invalidate($this->getTagDependencyCacheComponent(), [static::commonTag(), Post::commonTag(), $this->objectTag(), NamingHelper::getObjectTag(Post::className(), $this->getPrimaryKey())]);
     return true;
 }
コード例 #10
0
ファイル: Participant.php プロジェクト: pyw5pkU9PcdW/COMP3421
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getPosts()
 {
     return $this->hasMany(Post::className(), ['Participant_id' => 'id']);
 }
コード例 #11
0
 public function getPosts()
 {
     return $this->hasMany(Post::className(), ['cid' => 'id', 'status' => [Post::STATUS_PUBLISHED, Post::STATUS_HIDDEN]])->orderBy(['is_top' => SORT_DESC, 'post_time' => SORT_DESC]);
 }