Skip to content

Poll Object

Anton Alexeev edited this page Mar 15, 2018 · 7 revisions

Fields:

'title'     : string

'active'    : tinyint

'anonymous' : tinyint

'position'  : integer

'type'      : string    - *Type of Poll

'closed_at' : datetime 

Available types of Poll:

  1. User can get only one Vote (like radio): \\OrangeShadow\\Polls\\Types\\SingleVote

  2. User can check some option (like checkbox) \\OrangeShadow\\Polls\\Types\\MultiVote

  3. User must specified order by priority \\OrangeShadow\\Polls\\Types\\VariableVote

You can write your poll type extends from PollTypeAbstract

Methods:

Get list of option

options() : Illuminate\Database\Eloquent\Relations\HasMany

Check is poll closed or not active

isClosed() : boolean

Get options count 

getOptionsCount(): integer

Get number of user who vote of poll

getVoterCount(): integer

Clone this wiki locally