/** * @param int $userId * @return Board[] */ public function getBoards($userId = null) { return $this->hasMany(Board::className(), ['id' => 'board_id'])->viaTable('cp_users_board_rights', ['board_rights_id' => 'id'], function ($query) use($userId) { if ($userId != null && is_numeric($userId)) { $query->andWhere(['user_id' => $userId]); } }); }
public function getBoards() { return $this->hasMany(Board::className(), ['id' => 'board_id'])->viaTable('bans_boards', ['bans_settings_id' => 'id']); }
public function getBoards() { return $this->hasMany(Board::className(), ['posts_settings_id' => 'id']); }
public function getBoards() { return $this->hasMany(Board::className(), ['id' => 'board_id'])->viaTable('boards_mime_types', ['mime_type_id' => 'id']); }