HumHub Documentation (unofficial)

LegacyStreamTrait

Contains legacy stream action functionality.

Tags
since
1.7

Table of Contents

Properties

$activeQuery  : ActiveQuery
$from  : int
First wall entry id to deliver
$mode  : string
$to  : int
Entry id of the top stream entry used for update requests

Methods

getContentResultEntry()  : array<string|int, mixed>
Returns an array contains all information required to display a content in stream.
renderEntry()  : string
Renders the wallEntry of the given ContentActiveRecord.
setupCriteria()  : mixed
setupFilters()  : mixed
isInitialRequest()  : bool
Is inital stream requests (show first stream content)
renderLegacyWallEntry()  : string
setDeprecatedActionProperties()  : mixed

Properties

$activeQuery

public ActiveQuery $activeQuery
Tags
deprecated

since 1.7 use StreamQuery->query()

$from

First wall entry id to deliver

public int $from
Tags
deprecated

since 1.7 use $streamQuery->from

$mode

public string $mode
Tags
deprecated

since 1.6 use ActivityStreamAction

$to

Entry id of the top stream entry used for update requests

public int $to
Tags
deprecated

since 1.7 use $streamQuery->to

Methods

getContentResultEntry()

Returns an array contains all information required to display a content in stream.

public static getContentResultEntry(Content $content) : array<string|int, mixed>
Parameters
$content : Content

the content

Tags
throws
Exception
deprecated

since 1.7

Return values
array<string|int, mixed>

renderEntry()

Renders the wallEntry of the given ContentActiveRecord.

public static renderEntry(ContentActiveRecord $record[, mixed $options = [] ][, bool $partial = true ]) : string

If setting $partial to false this function will use the renderAjax function instead of renderPartial, which will directly append all dependencies to the result and if not used in a real ajax request will also append the Layoutadditions.

Render options can be provided by setting the $options array. This array will be passed to the WallEntryWidget implementation of the given ContentActiveRecord. The render option array can for example be used to deactivate the rendering of the the WallEntryControls, Addons etc.

The used jsWidget implementation of the WallEntry can be overwritten by $options['jsWidget'].

e.g:

Stream::renderEntry($myModel, [
     'jsWidget' => 'my.namespace.StreamEntry',
     'renderControls' => false
]);

The previous example deactivated the rendering of the WallEntryControls and set a specific property of the WallEntryWidget related to $myModel.

Parameters
$record : ContentActiveRecord

content record instance

$options : mixed = []

array render options

$partial : bool = true

whether or not to use renderPartial over renderAjax

Tags
throws
Exception
deprecated

since 1.7 use StreamEntryWidget::renderStreamEntry() instead

Return values
string

rendered wallentry

setupCriteria()

public setupCriteria() : mixed
Tags
deprecated

since 1.7 use Stream::beforeApplyFilters()

setupFilters()

public setupFilters() : mixed
Tags
deprecated

since 1.7 use Stream::beforeApplyFilters()

isInitialRequest()

Is inital stream requests (show first stream content)

protected isInitialRequest() : bool
Tags
deprecated

since 1.6 use StreamQuery::isInitialQuery

Return values
bool

Is initial request

renderLegacyWallEntry()

private static renderLegacyWallEntry(ContentActiveRecord $record[, array<string|int, mixed> $options = [] ][, bool $partial = true ]) : string
Parameters
$record : ContentActiveRecord
$options : array<string|int, mixed> = []
$partial : bool = true
Tags
throws
Exception
since

since 1.7

Return values
string

setDeprecatedActionProperties()

private setDeprecatedActionProperties() : mixed

        
On this page

Search results