LegacyStreamTrait
Contains legacy stream action functionality.
Tags
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
$from
First wall entry id to deliver
public
int
$from
Tags
$mode
public
string
$mode
Tags
$to
Entry id of the top stream entry used for update requests
public
int
$to
Tags
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
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
Return values
string —rendered wallentry
setupCriteria()
public
setupCriteria() : mixed
Tags
setupFilters()
public
setupFilters() : mixed
Tags
isInitialRequest()
Is inital stream requests (show first stream content)
protected
isInitialRequest() : bool
Tags
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
Return values
stringsetDeprecatedActionProperties()
private
setDeprecatedActionProperties() : mixed