Class humhub\modules\stream\models\StreamSuppressQuery

Inheritancehumhub\modules\stream\models\StreamSuppressQuery » humhub\modules\stream\models\StreamQuery » yii\base\Model
Subclasseshumhub\modules\stream\models\WallStreamQuery
Available since version1.2

StreamSuppressQuery detects same content types in a row and trims the output.

E.g. if there are 5 files in a row, only two files will be returned. All following files are stored and can be obtained via method getSuppressed().

See also humhub\modules\stream\actions\Stream.

Protected Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$_built boolean Query built humhub\modules\stream\models\StreamQuery
$_query \yii\db\ActiveQuery humhub\modules\stream\models\StreamQuery
$isQueryExecuted boolean Marks query as executed humhub\modules\stream\models\StreamSuppressQuery
$lastContentId integer The last returned content id humhub\modules\stream\models\StreamSuppressQuery
$preventSuppression boolean This flag will disable the suppression behaviour if set to true humhub\modules\stream\models\StreamSuppressQuery
$suppressions array Suppressed contents (format: [displayedContentId] = [suppressedContentId1, suppressedContentId2]) humhub\modules\stream\models\StreamSuppressQuery
$suppressionsOnly boolean Return humhub\modules\stream\models\StreamSuppressQuery

Events

Hide inherited events

EventTypeDescriptionDefined By
EVENT_BEFORE_FILTER \humhub\modules\stream\models\Event Triggered before filterHandlers are applied, this can be used to add custom stream filters. humhub\modules\stream\models\StreamQuery

Constants

Hide inherited constants

ConstantValueDescriptionDefined By
CHANNEL_ACTIVITY 'activity' humhub\modules\stream\models\StreamQuery
CHANNEL_DEFAULT 'default' Default channels humhub\modules\stream\models\StreamQuery
MAX_LIMIT 20 Maximum wall entries per request humhub\modules\stream\models\StreamQuery

Property Details

$isQueryExecuted protected property

Marks query as executed

protected boolean $isQueryExecuted false
$lastContentId protected property

The last returned content id

protected integer $lastContentId null
$preventSuppression protected property

This flag will disable the suppression behaviour if set to true

protected boolean $preventSuppression false
$suppressionScanSize public property

Size of suppression row lookup

$suppressions protected property

Suppressed contents (format: [displayedContentId] = [suppressedContentId1, suppressedContentId2])

protected array $suppressions = []
$suppressionsOnly protected property

Return

protected boolean $suppressionsOnly false

Method Details

addSuppression() public method

Adds new suppression

public void addSuppression ( $parentContent, $content )
$parentContent humhub\modules\content\models\Content
$content humhub\modules\content\models\Content
all() public method

public void all ( )
allSuppressions() protected method

This is a special case, this is used to "load more" of suppressed contents.

protected humhub\modules\content\models\Content[] allSuppressions ( )
return humhub\modules\content\models\Content[]

The list of content objects

formName() public method

public void formName ( )
getLastContentId() public method

Returns the last content id of the stream query.

It may also contains a suppressed content id.

public integer getLastContentId ( )
return integer

Content id

getSuppressions() public method

Returns suppressed content ids

public array getSuppressions ( )
throws \yii\base\Exception
isSuppressed() protected method

Checks if this content should be suppressed

protected boolean isSuppressed ( &$results, $content )
$results array

A reference of the current results

$content humhub\modules\content\models\Content

The content object to check

return boolean

Is suppressed item

load() public method

public void load ( $data, $formName null )
$data
$formName
rules() public method

public void rules ( )