Class humhub\modules\stream\models\StreamQuery

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

Description of StreamQuery

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

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

$_built protected property

Query built

protected boolean $_built false
$_query protected property
protected \yii\db\ActiveQuery $_query null
$channel public property

Stream channel to display

public string $channel self::CHANNEL_DEFAULT
$contentId public property
public integer $contentId null
$excludes public property

Content type filter

public array $excludes null
$filterHandlers public property (available since version 1.3)

Additional query filter handler

See also [[setupFilters()]].

public array $filterHandlers = [\humhub\modules\stream\models\filters\DefaultStreamFilter::class, \humhub\modules\stream\models\filters\TopicStreamFilter::class, \humhub\modules\stream\models\filters\ContentTypeStreamFilter::class, \humhub\modules\stream\models\filters\OriginatorStreamFilter::class]
$filters public property
public array $filters = []
$from public property
public integer $from 0
$includes public property

Content type filter

public array $includes null
$limit public property
public integer $limit null
$originator public property
$sort public property
public string $sort null
$user public property

Method Details

addFilter() public method

public void addFilter ( $filters )
$filters
all() public method

public void all ( )
channel() public method

Sets the channel for this stream query

public humhub\modules\stream\models\StreamQuery channel ( $channel )
$channel string
checkFrom() protected method

protected void checkFrom ( )
checkLimit() protected method

protected void checkLimit ( )
checkSort() protected method

protected void checkSort ( )
checkUser() protected method

protected void checkUser ( )
content() public method

public void content ( $contentId )
$contentId
excludes() public method

public void excludes ( $types = [] )
$types
filter() public method

public void filter ( $limit self::MAX_LIMIT )
$limit
filters() public method

public void filters ( $filters = [] )
$filters
find() public static method

Static initializer.

public static humhub\modules\stream\models\StreamQuery find ( $includes = [], $excludes = [] )
$includes array|string|integer

Either an array of ContentActiveRecord class names or single class name or single contentId.

$excludes array|string

Either an array of ContentActiveRecord class names or single class name to exclude from the query.

forUser() public method

public void forUser ( $user null )
$user
from() public method

public void from ( $from 0 )
$from
includes() public method

public void includes ( $includes = [] )
$includes
init() public method

public void init ( )
isSingleContentQuery() public method

public void isSingleContentQuery ( )
limit() public method

public void limit ( $limit self::MAX_LIMIT )
$limit
originator() public method

public void originator ( $user )
$user
query() public method

public void query ( $build false )
$build
rules() public method

public void rules ( )
setupCriteria() protected method

protected void setupCriteria ( )
setupFilters() protected method

protected void setupFilters ( )
setupQuery() protected method

protected void setupQuery ( )

Event Details

EVENT_BEFORE_FILTER event of type \humhub\modules\stream\models\Event

Triggered before filterHandlers are applied, this can be used to add custom stream filters.