CoolCMS API

VoteTrait

Table of Contents

Methods

handleReport()  : void
Writes to the DB; AJAX only. A bare GET (robot, link prefetch) ends with 403.
handleThumbsDown()  : void
Writes to the DB; AJAX only. A bare GET (robot, link prefetch) ends with 403.
handleThumbsUp()  : void
Writes to the DB; AJAX only. A bare GET (robot, link prefetch) ends with 403.
bumpDisplayedVotes()  : void
Raises the counter on the displayed in-memory entity after a successful vote, without a DB read.

Methods

handleReport()

Writes to the DB; AJAX only. A bare GET (robot, link prefetch) ends with 403.

public handleReport(int $messageId[, string $style = 'Style_1' ]) : void
Parameters
$messageId : int
$style : string = 'Style_1'
Attributes
#[Requires]
$ajax: true

handleThumbsDown()

Writes to the DB; AJAX only. A bare GET (robot, link prefetch) ends with 403.

public handleThumbsDown(int $messageId[, string $style = 'Style_1' ]) : void
Parameters
$messageId : int
$style : string = 'Style_1'
Attributes
#[Requires]
$ajax: true

handleThumbsUp()

Writes to the DB; AJAX only. A bare GET (robot, link prefetch) ends with 403.

public handleThumbsUp(int $messageId[, string $style = 'Style_1' ]) : void
Parameters
$messageId : int
$style : string = 'Style_1'
Attributes
#[Requires]
$ajax: true

bumpDisplayedVotes()

Raises the counter on the displayed in-memory entity after a successful vote, without a DB read.

private bumpDisplayedVotes(Message $message, int $messageId, string $property) : void

votesUp / votesDown do not invalidate the query cache (MessageManager::$nonInvalidatingColumns), so the component entity (loaded before the vote) would otherwise show a value one lower. A duplicate vote never gets here (called only on the success branch). Only the message of this component is raised: the id from the URL must match.

Parameters
$message : Message
$messageId : int
$property : string
On this page

Search results