Class humhub\modules\live\controllers\PollController

Inheritancehumhub\modules\live\controllers\PollController » humhub\components\Controller » yii\web\Controller
Available since version1.2

PollController is used by the live database driver to deliever events

See also \humhub\modules\live\driver\Database.

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$actionTitlesMap array Page titles humhub\components\Controller
$maxEventsByQuery integer Maximum events by query humhub\modules\live\controllers\PollController
$maxTimeDecay integer Maximum decay for last query time humhub\modules\live\controllers\PollController
$pageTitle string Title of the rendered page humhub\components\Controller
$prependActionTitles boolean Append page title humhub\components\Controller
$subLayout null|string The name of the sub layout to be applied to this controller's views. humhub\components\Controller

Protected Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$access string Defines the ControllerAccess class for this controller responsible for managing access rules humhub\components\Controller
$containerIds array humhub\modules\live\controllers\PollController

Public Methods

Hide inherited methods

MethodDescriptionDefined By
actionIndex() Returns a list of new live events for the current user The GET parameter is a unix timestamp of the last update. humhub\modules\live\controllers\PollController
appendPageTitle() Append a page title. humhub\components\Controller
beforeAction() humhub\modules\live\controllers\PollController
behaviors() humhub\components\Controller
forcePostRequest() Throws HttpException in case the request is not an post request, otherwise returns true. humhub\components\Controller
getAccess() humhub\components\Controller
htmlRedirect() Create Redirect for AJAX Requests which output goes into HTML content. humhub\components\Controller
init() humhub\components\Controller
prependPageTitle() Prepend a page title. humhub\components\Controller
redirect() humhub\components\Controller
renderAjaxContent() humhub\components\Controller
renderContent() Renders a static string by applying the layouts (sublayout + layout. humhub\components\Controller
renderModalClose() Closes a modal humhub\components\Controller
setActionTitles() Set a map that indicates what page title should be shown for the currently active action. humhub\components\Controller
setJsViewStatus() Sets some ui state as current controller/module and active topmenu. humhub\components\Controller
setPageTitle() Set the page title. humhub\components\Controller

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
buildLookupQuery() Creates a query to lookup live events. humhub\modules\live\controllers\PollController
checkVisibility() Checks if the live event is visible for the current user. humhub\modules\live\controllers\PollController
forbidden() humhub\components\Controller
getAccessRules() Returns access rules for the standard access control behavior. humhub\components\Controller
getLastQueryTime() Returns the last query timestamp by the last GET parameter The parameter is validated, if invalid or empty the current time will be returned. humhub\modules\live\controllers\PollController
unserializeEvent() Unserializes an event from database humhub\modules\live\controllers\PollController

Events

Hide inherited events

EventTypeDescriptionDefined By
EVENT_INIT \yii\base\Event An event raised on init a controller. humhub\components\Controller

Property Details

$containerIds protected property
protected array $containerIds = []
$maxEventsByQuery public property

Maximum events by query

$maxTimeDecay public property

Maximum decay for last query time

public integer $maxTimeDecay 500

Method Details

actionIndex() public method

Returns a list of new live events for the current user The GET parameter is a unix timestamp of the last update.

public string actionIndex ( )
return string

The json response

beforeAction() public method

public void beforeAction ( $action )
$action
buildLookupQuery() protected method

Creates a query to lookup live events.

protected \yii\db\ActiveQuery buildLookupQuery ( $lastQueryTime )
$lastQueryTime integer

The last lookup

return \yii\db\ActiveQuery

The query

checkVisibility() protected method

Checks if the live event is visible for the current user.

protected boolean checkVisibility ( humhub\modules\live\components\LiveEvent $liveEvent )
$liveEvent humhub\modules\live\components\LiveEvent
return boolean

Is visible

getLastQueryTime() protected method

Returns the last query timestamp by the last GET parameter The parameter is validated, if invalid or empty the current time will be returned.

protected integer getLastQueryTime ( )
return integer

The validated last query time

unserializeEvent() protected method

Unserializes an event from database

protected humhub\modules\live\components\LiveEvent unserializeEvent ( $serializedEvent )
$serializedEvent
return humhub\modules\live\components\LiveEvent

The live event