Vote
in package
uses
TraitDataWrite, TraitUser
Table of Contents
Properties
- $env : array<string|int, mixed>
- $nRecordID : int
- $nUserID : int
- $strTable : string
- $voteIcons : VoteIcons
Methods
- __construct() : mixed
- ajaxWriteVoteGetResult() : array<string|int, mixed>
- getDataWriteInstance() : DataWrite
- getFiveBox() : string
- Gets the complete 5 stars votingbox Will be called via x_get_data
- getFiveStars() : string
- Returns the five stars in html elements for later ajax use
- getSummary() : array<string|int, mixed>
- Get summary vote and persons of this entry
- getUserInstance() : User
- updateVoteTable() : void
- determineAjaxAction() : string
- getAjaxVotesTemplate() : string
- getInfoSQL() : string
- Nur das SQL für summe, anzahl
- getMembersVote() : array{id: int, vote: int}
- get vote infos from a user
- getPlaceHoldersAndValues() : array{nRecordID: int, strAction: string, strRandom: string, strTable: string, strVoteImg: string, cleanhtml: string, strVoted: string}
- getVoteCheck() : array<string|int, mixed>
- getVoteImage() : array<string|int, mixed>
- getVoteOptions() : string
- getVoteStatus() : string
- writeVote() : int
- Writes the Vote to a record
Properties
$env
private
array<string|int, mixed>
$env
$nRecordID
private
int
$nRecordID
$nUserID
private
int
$nUserID
$strTable
private
string
$strTable
$voteIcons
private
VoteIcons
$voteIcons
Methods
__construct()
public
__construct([string $strTable = '' ][, int $nRecordID = 0 ]) : mixed
Parameters
- $strTable : string = ''
- $nRecordID : int = 0
-
the record id
ajaxWriteVoteGetResult()
public
ajaxWriteVoteGetResult(int $vote) : array<string|int, mixed>
Parameters
- $vote : int
Return values
array<string|int, mixed>getDataWriteInstance()
public
getDataWriteInstance() : DataWrite
Return values
DataWritegetFiveBox()
Gets the complete 5 stars votingbox Will be called via x_get_data
public
getFiveBox() : string
Tags
Return values
string —: complete html
getFiveStars()
Returns the five stars in html elements for later ajax use
public
getFiveStars([bool $bCleanHtml = false ]) : string
Parameters
- $bCleanHtml : bool = false
-
if true, we clean the html of the ajaxbox, needed in lists
Tags
Return values
stringgetSummary()
Get summary vote and persons of this entry
public
getSummary() : array<string|int, mixed>
Return values
array<string|int, mixed> —$array[0] = votes $array[1] = persons
getUserInstance()
public
getUserInstance() : User
Return values
UserupdateVoteTable()
public
updateVoteTable(string $strVoteTable) : void
Parameters
- $strVoteTable : string
determineAjaxAction()
private
determineAjaxAction() : string
Return values
stringgetAjaxVotesTemplate()
private
getAjaxVotesTemplate(int $nVI) : string
Parameters
- $nVI : int
Return values
stringgetInfoSQL()
Nur das SQL für summe, anzahl
private
getInfoSQL() : string
Return values
stringgetMembersVote()
get vote infos from a user
private
getMembersVote(array<string|int, mixed> $saVoted) : array{id: int, vote: int}
Parameters
- $saVoted : array<string|int, mixed>
-
, record_id, table_name
Return values
array{id: int, vote: int}getPlaceHoldersAndValues()
private
getPlaceHoldersAndValues(array<string|int, mixed> $voteInfo, string $strAction, bool $bCleanHtml) : array{nRecordID: int, strAction: string, strRandom: string, strTable: string, strVoteImg: string, cleanhtml: string, strVoted: string}
Parameters
- $voteInfo : array<string|int, mixed>
- $strAction : string
- $bCleanHtml : bool
Tags
Return values
array{nRecordID: int, strAction: string, strRandom: string, strTable: string, strVoteImg: string, cleanhtml: string, strVoted: string}getVoteCheck()
private
getVoteCheck() : array<string|int, mixed>
Return values
array<string|int, mixed>getVoteImage()
private
getVoteImage() : array<string|int, mixed>
Return values
array<string|int, mixed>getVoteOptions()
private
getVoteOptions(array<string|int, mixed> $saVoted) : string
Parameters
- $saVoted : array<string|int, mixed>
Tags
Return values
stringgetVoteStatus()
private
getVoteStatus() : string
Tags
Return values
stringwriteVote()
Writes the Vote to a record
private
writeVote(int $nVote) : int
the values are in steps of 2,4,6,8,10
Parameters
- $nVote : int