Stud.IP  jlu_3.3 Revision
Vote Class Reference
Inheritance diagram for Vote:
Inheritance graph
Collaboration diagram for Vote:
Collaboration graph

Public Member Functions

 Vote ($oldVoteID="")
 
 finalize ()
 
 setTitle ($title)
 
 getTitle ()
 
 setQuestion ($question)
 
 getQuestion ()
 
 setAnswers ($answerArray)
 
 addSlashesToText ()
 
 getAnswers ()
 
 setStartdate ($timestamp)
 
 getStartdate ()
 
 setStopdate ($timestamp)
 
 getStopdate ()
 
 getRealStopdate ()
 
 getCreationdate ()
 
 getChangedate ()
 
 setTimespan ($seconds)
 
 getTimespan ()
 
 setMultiplechoice ($multiplechoice)
 
 isMultiplechoice ()
 
 setResultvisibility ($mode)
 
 getResultvisibility ()
 
 setNamesvisibility ($namesvisibility)
 
 getNamesvisibility ()
 
 setAnonymous ($anonymous)
 
 isAnonymous ()
 
 setChangeable ($changeable)
 
 isChangeable ()
 
 isVisible ()
 
 setVoteID ($objectID)
 
 getVoteID ()
 
 setRangeID ($rangeID)
 
 getRangeID ()
 
 setAuthorID ($authorID)
 
 getAuthorID ()
 
 isInUse ()
 
 isNew ()
 
 isActive ()
 
 isStopped ()
 
 sortVoteAnswers ()
 
 getMaxAnswer ()
 
 getNumberAnswers ()
 
 getNumberPersons ()
 
 executeAssociate ($userID, $answerArray)
 
 executeStart ()
 
 executeStop ()
 
 executeRemove ()
 
 executeRestart ()
 
 executeContinue ()
 
 executeSetVisible ($visibility)
 
 executeWrite ()
 
 readVote ()
 
 setIsInUse ($isInUse)
 
 setState ($state)
 
 setCreationdate ($timestamp)
 
 setChangedate ($timestamp)
 
 getState ()
 
 checkConsistency ()
 
 sortVoteAnswerarray ($a, $b)
 
- Public Member Functions inherited from StudipObject
 StudipObject ($objectID="")
 
 createNewID ()
 
 getObjectID ()
 
 setObjectID ($objectID)
 
 getAuthorID ()
 
 getAuthor ()
 
 getFullname ()
 
 setAuthorID ($authorID)
 
 getRangeID ()
 
 setRangeID ($rangeID)
 
- Public Member Functions inherited from AuthorObject
 AuthorObject ()
 
 finalize ()
 
 setAuthorEmail ($email)
 
 getAuthorEmail ()
 
 setAuthorName ($name)
 
 getAuthorName ()
 
 x_instanceof ()
 
 isError ()
 
 getErrors ()
 
 resetErrors ()
 
 throwError ($errcode, $errstring, $errline=0, $errfile=0, $errtype=ERROR_NORMAL)
 
 throwErrorFromClass (&$class)
 
 errorHandler ($no, $str, $file, $line, $ctx)
 

Static Public Member Functions

 date2timestamp ($date, $hour=0, $minute=0, $second=0)
 

Data Fields

 $title
 
 $question
 
 $answerArray
 
 $startdate
 
 $stopdate
 
 $timespan
 
 $creationdate
 
 $changedate
 
 $multiplechoice
 
 $anonymous
 
 $changeable
 
 $visible
 
 $resultvisibility
 
 $namesvisibility
 
 $isInUse
 
 $state
 
 $objectID
 
 $rangeID
 
 $authorID
 
 $voteDB
 
- Data Fields inherited from StudipObject
 $objectID
 
 $authorID
 
 $rangeID
 
- Data Fields inherited from AuthorObject
 $errorArray
 
 $authorEmail
 
 $authorName
 
 $instanceof
 

Member Function Documentation

◆ addSlashesToText()

addSlashesToText ( )

make mysql happy

Here is the call graph for this function:

◆ checkConsistency()

checkConsistency ( )

Checks the consostency of the vote (internal!) @access private

Exceptions
error

Reimplemented in TestVote.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ date2timestamp()

date2timestamp (   $date,
  $hour = 0,
  $minute = 0,
  $second = 0 
)
static

Checks and transforms a date into a UNIX (r)(tm) timestamp @access public

Parameters
integer$dayThe day
integer$monthThe month
integer$yearThe year
integer$hourThe hour (optional)
integer$minuteThe minute (optional)
integer$secondThe second (optional)
Returns
integer If an error occurs -> -1. Otherwise the UNIX-timestamp

◆ executeAssociate()

executeAssociate (   $userID,
  $answerArray 
)

Associate a user with an answer or vote in the database (!) @access public

Parameters
string$userIDThe unique user ID
array$answerArrayAn array with one or more answers
Exceptions
error
Here is the call graph for this function:

◆ executeContinue()

executeContinue ( )

Continues the vote in the database (!) @access public

Exceptions
error
Here is the call graph for this function:

◆ executeRemove()

executeRemove ( )

Removes the vote from the database (!) @access public

Exceptions
error
Here is the call graph for this function:

◆ executeRestart()

executeRestart ( )

Restarts the vote in the database (!) @access public

Exceptions
error
Here is the call graph for this function:

◆ executeSetVisible()

executeSetVisible (   $visibility)

Sets the visibility of a stopped vote in the database (!) @access public

Parameters
boolean$visibilityIf YES -> Stopped vote gets visible
Exceptions
error
Here is the call graph for this function:

◆ executeStart()

executeStart ( )

Starts the vote in the database (!) @access public

Exceptions
error
Here is the call graph for this function:

◆ executeStop()

executeStop ( )

Stops the vote in the database (!) @access public

Exceptions
error
Here is the call graph for this function:

◆ executeWrite()

executeWrite ( )

Writes the vote into the database (!) @access public

Exceptions
error

Reimplemented in TestVote.

Here is the call graph for this function:

◆ finalize()

finalize ( )

Destructor @access public

Reimplemented from AuthorObject.

◆ getAnswers()

getAnswers ( )

Gets the answers @access public

Returns
array The answers.
Here is the caller graph for this function:

◆ getAuthorID()

getAuthorID ( )

Gets the unique user ID from the owner of the vote @access public

Returns
string The unique user ID

Reimplemented from StudipObject.

Here is the caller graph for this function:

◆ getChangedate()

getChangedate ( )

Gets the change date @access public

Returns
integer Change date as a UNIX timestamp.
Here is the caller graph for this function:

◆ getCreationdate()

getCreationdate ( )

Gets the creation date @access public

Returns
integer Creation date as a UNIX timestamp.
Here is the caller graph for this function:

◆ getMaxAnswer()

getMaxAnswer ( )

Gets the number of votes from the answer with the most votes @access public

Returns
the number
Here is the call graph for this function:

◆ getNamesvisibility()

getNamesvisibility ( )

Gets whether the names of participants will be publicly visible @access public

Returns
boolean
Here is the caller graph for this function:

◆ getNumberAnswers()

getNumberAnswers ( )

Gets the total number of votes @access public

Returns
the number
Here is the call graph for this function:

◆ getNumberPersons()

getNumberPersons ( )

Gets the total number of persons who voted @access public

Returns
the number

◆ getQuestion()

getQuestion ( )

Gets the question of a vote @access public

Returns
string The question of a vote
Here is the caller graph for this function:

◆ getRangeID()

getRangeID ( )

Gets the unique range ID from the vote @access public

Returns
string The unique range ID

Reimplemented from StudipObject.

Here is the caller graph for this function:

◆ getRealStopdate()

getRealStopdate ( )

Gets the real stop date as a UNIX-timestamp (e.g. startdate + timespan) @access public

Returns
integer The UNIX-timestamp with the real stopdate
Here is the call graph for this function:

◆ getResultvisibility()

getResultvisibility ( )

Gets the way how to show the results @access public

Returns
string The mode. See VOTE_RESULTS_*
Here is the caller graph for this function:

◆ getStartdate()

getStartdate ( )

Gets the start date @access public

Returns
integer Start date as a UNIX timestamp
Here is the caller graph for this function:

◆ getState()

getState ( )

Gets the internal state of a vote (internal!) @access private

Returns
integer The State. See VOTE_*
Here is the caller graph for this function:

◆ getStopdate()

getStopdate ( )

Gets the stop date @access public

Returns
integer End date as a UNIX timestamp.
Here is the caller graph for this function:

◆ getTimespan()

getTimespan ( )

Gets the timespan @access public

Returns
integer The timespan in days
Here is the caller graph for this function:

◆ getTitle()

getTitle ( )

Gets the title of a vote @access public

Returns
string The title of a vote
Here is the caller graph for this function:

◆ getVoteID()

getVoteID ( )

Gets the unique ID from the vote @access public

Returns
string The unique ID
Here is the caller graph for this function:

◆ isActive()

isActive ( )

Checks whether the vote is active @access public

Returns
boolean YES if vote is active

◆ isAnonymous()

isAnonymous ( )

Checks whether the vote is to be linked with a user @access public

Returns
boolean YES if vote is not linked with a user
Here is the caller graph for this function:

◆ isChangeable()

isChangeable ( )

Checks whether the it´s allowed to change the answer @access public

Returns
boolean YES if it´s allowed to change the answer
Here is the caller graph for this function:

◆ isInUse()

isInUse ( )

Check whether a user had already used this vote @access public

Returns
bollean YES if a user had already used the vote
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isMultiplechoice()

isMultiplechoice ( )

Checks whether multiple choice is allowed @access public

Returns
boolean If multiple choice is allowed -> YES
Here is the caller graph for this function:

◆ isNew()

isNew ( )

Checks whether the vote is new @access public

Returns
boolean YES if vote is new
Here is the caller graph for this function:

◆ isStopped()

isStopped ( )

Checks whether the vote is stopped @access public

Returns
boolean YES if vote is stopped
Here is the caller graph for this function:

◆ isVisible()

isVisible ( )

Checks whether the vote is visible @access public

Returns
boolean YES if vote is visible
Here is the caller graph for this function:

◆ readVote()

readVote ( )

Loads an old vote (internal!) @access private

Exceptions
error

Reimplemented in TestVote.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setAnonymous()

setAnonymous (   $anonymous)

Defines whether the vote is to be linked with a user @access public

Parameters
boolean$anonymousYES if vote is not be linked with a user
Exceptions
error
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setAnswers()

setAnswers (   $answerArray)

Sets the answers @access public

Parameters
array$answerArrayThe answer(s)
Exceptions
error

Reimplemented in TestVote.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setAuthorID()

setAuthorID (   $authorID)

Sets the unique author ID from the vote @access public

Parameters
string$authorIDThe unique author ID

Reimplemented from StudipObject.

Here is the caller graph for this function:

◆ setChangeable()

setChangeable (   $changeable)

Defines whether it´s allowed for a user to change his/her answer @access public

Parameters
boolean$changeableYES if it´s allowed to change the answer
Exceptions
error
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setChangedate()

setChangedate (   $timestamp)

Sets the change date (internal!) @access private

Parameters
integer$timestampThe UNIX-timestamp from the change day
Exceptions
error
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setCreationdate()

setCreationdate (   $timestamp)

Sets the create date (internal!) @access private

Parameters
integer$timestampThe UNIX-timestamp from the create day
Exceptions
error
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setIsInUse()

setIsInUse (   $isInUse)

Sets isInUse (internal!) @access private

Parameters
integer$isInUseYES / NO
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setMultiplechoice()

setMultiplechoice (   $multiplechoice)

Defines whether multiple choice is allowed @access public

Parameters
boolean$multiplechoiceYES if multiple choice is allowed
Exceptions
error
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setNamesvisibility()

setNamesvisibility (   $namesvisibility)

Defines whether the names of participants will be publicly visible @access public

Parameters
boolean$namesvisibilityYES if names shall be visible
Exceptions
error
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setQuestion()

setQuestion (   $question)

Sets the question of a vote @access public

Parameters
string$questionThe question of a vote
Exceptions
error
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setRangeID()

setRangeID (   $rangeID)

Sets the unique range ID from the vote @access public

Parameters
string$rangeIDThe unique range ID

Reimplemented from StudipObject.

Here is the caller graph for this function:

◆ setResultvisibility()

setResultvisibility (   $mode)

Sets the way how to show the results @access public

Parameters
integer$modeSee const VOTE_RESULTS_*
Exceptions
error
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setStartdate()

setStartdate (   $timestamp)

Sets the start date @access public

Parameters
integer$timestampThe UNIX-timestamp from the start day
Exceptions
error
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setState()

setState (   $state)

Sets the state (internal!) @access private

Parameters
integer$stateThe state of the vote. See VOTE_*
Exceptions
error
Here is the caller graph for this function:

◆ setStopdate()

setStopdate (   $timestamp)

Sets the stop date @access public

Parameters
integer$timestampThe UNIX-timestamp from the end day
Exceptions
error
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setTimespan()

setTimespan (   $seconds)

Sets the timespan @access public

Parameters
integer$secondsThe timespan in seconds
Exceptions
error
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setTitle()

setTitle (   $title)

Sets the title of a vote @access public

Parameters
string$titleThe title of a vote
Exceptions
error
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setVoteID()

setVoteID (   $objectID)

Sets the unique ID from the vote @access public

Parameters
string$objectIDThe unique ID

◆ sortVoteAnswerarray()

sortVoteAnswerarray (   $a,
  $b 
)

Sorts the answerarray

Parameters
array$afirst answerarray
array$bsecond answerarray @access private

◆ sortVoteAnswers()

sortVoteAnswers ( )

Sorts the answerarray @access public

◆ Vote()

Vote (   $oldVoteID = "")

Constructor @access public

Parameters
string$oldVoteIDThe ID of an existing vote
Exceptions
error
Here is the call graph for this function:

Field Documentation

◆ $anonymous

boolean $anonymous

Defines whether the vote is to be linked with a user. @access private

◆ $answerArray

array $answerArray

The possible anwers of the vote. @access private

◆ $authorID

string $authorID

The unique userID of the author of the vote @access private

◆ $changeable

boolean $changeable

Defines whether it is allowed to change the answers @access private

◆ $changedate

integer $changedate

Time of last change. Is set automatically. @access private

◆ $creationdate

integer $creationdate

Time of creation. Is set automatically. @access private

◆ $isInUse

boolean $isInUse

Defines whether a user had already used this vote @access private

◆ $multiplechoice

boolean $multiplechoice

Defines whether multiple choice is allowed. @access private

◆ $namesvisibility

integer $namesvisibility

Defines whether a user can see the participants of the vote. @access private

◆ $objectID

integer $objectID

The unique ID of the vote @access private

◆ $question

string $question

The question of the vote. @access private

◆ $rangeID

string $rangeID

The unique range ID of the vote @access private

◆ $resultvisibility

integer $resultvisibility

Defines how to show the result. See const VOTE_RESULTS_* @access private

◆ $startdate

integer $startdate

Startdate @access private

◆ $state

string $state

Holds the DB-state the state of the vote. See constants VOTE_* @access private

◆ $stopdate

integer $stopdate

Stopdate @access private

◆ $timespan

integer $timespan

timespan @access private

◆ $title

string $title

The title of the vote. @access private

◆ $visible

integer $visible

Defines whether the vote is visible or not @access private

◆ $voteDB

object VoteDB $voteDB

Holds the VoteDB object @access public


The documentation for this class was generated from the following file: