Merge pull request #4624 from humhub/fix/legacyStreamTraitDoc

Fix/legacy stream trait doc
This commit is contained in:
Lucas Bartholemy 2020-11-11 16:00:59 +01:00 committed by GitHub
commit fa9cbcf6f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 2 deletions

View File

@ -194,12 +194,12 @@ trait LegacyStreamTrait
$this->setupFilters();
}
/**
* @deprecated since 1.7 use afterStreamQueryBuild
* @deprecated since 1.7 use Stream::beforeApplyFilters()
*/
public function setupCriteria(){}
/**
* @deprecated since 1.7 use afterStreamQueryBuild
* @deprecated since 1.7 use Stream::beforeApplyFilters()
*/
public function setupFilters(){ }

View File

@ -245,6 +245,17 @@ abstract class Stream extends Action
* At this point the StreamQuery has already been loaded with request data.
* Subclasses may overwrite this function in order to do some last settings on the StreamQuery instance.
*
* When overriding this method, make sure you call the parent implementation like the following:
*
* ```php
* public function beforeApplyFilters()
* {
* // Add some filters here
*
* parent::beforeApplyFilters();
* }
* ```
*
* When overriding this method, make sure you call the parent implementation at the beginning of your function.
* @throws \yii\base\InvalidConfigException
*/
@ -277,6 +288,17 @@ abstract class Stream extends Action
* most StreamQuery settings as filters won't have any effect. Since the query is not yet executed the
* StreamQuery->query() can still be used for custom query conditions.
*
* When overriding this method, make sure you call the parent implementation like the following:
*
* ```php
* public function afterApplyFilters()
* {
* // Manipulate query...
*
* parent::afterApplyFilters();
* }
* ```
*
* When overriding this method, make sure you call the parent implementation at the beginning of your function.
*/
protected function afterApplyFilters()