Stud.IP  2.0 Revision 48548
 All Data Structures Namespaces Files Functions Variables Pages
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)
 getAuthor ()
 getFullname ()
- Public Member Functions inherited from AuthorObject
 AuthorObject ()
 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 ($day, $month, $year, $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 ( )

make mysql happy

Here is the call graph for this function:

checkConsistency ( )

Checks the consostency of the vote (internal!) private

Exceptions
error

Reimplemented in TestVote.

Here is the call graph for this function:

Here is the caller graph for this function:

date2timestamp (   $day,
  $month,
  $year,
  $hour = 0,
  $minute = 0,
  $second = 0 
)
static

Checks and transforms a date into a UNIX (r)(tm) timestamp 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 (   $userID,
  $answerArray 
)

Associate a user with an answer or vote in the database (!) 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 ( )

Continues the vote in the database (!) public

Exceptions
error

Here is the call graph for this function:

executeRemove ( )

Removes the vote from the database (!) public

Exceptions
error

Here is the call graph for this function:

executeRestart ( )

Restarts the vote in the database (!) public

Exceptions
error

Here is the call graph for this function:

executeSetVisible (   $visibility)

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

Parameters
boolean$visibilityIf YES -> Stopped vote gets visible
Exceptions
error

Here is the call graph for this function:

executeStart ( )

Starts the vote in the database (!) public

Exceptions
error

Here is the call graph for this function:

executeStop ( )

Stops the vote in the database (!) public

Exceptions
error

Here is the call graph for this function:

executeWrite ( )

Writes the vote into the database (!) public

Exceptions
error

Reimplemented in TestVote.

Here is the call graph for this function:

finalize ( )

Destructor public

Reimplemented from AuthorObject.

getAnswers ( )

Gets the answers public

Returns
array The answers.

Here is the caller graph for this function:

getAuthorID ( )

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

Returns
string The unique user ID

Reimplemented from StudipObject.

Here is the caller graph for this function:

getChangedate ( )

Gets the change date public

Returns
integer Change date as a UNIX timestamp.

Here is the caller graph for this function:

getCreationdate ( )

Gets the creation date public

Returns
integer Creation date as a UNIX timestamp.

Here is the caller graph for this function:

getMaxAnswer ( )

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

Returns
the number

Here is the call graph for this function:

getNamesvisibility ( )

Gets whether the names of participants will be publicly visible public

Returns
boolean

Here is the caller graph for this function:

getNumberAnswers ( )

Gets the total number of votes public

Returns
the number

Here is the call graph for this function:

getNumberPersons ( )

Gets the total number of persons who voted public

Returns
the number
getQuestion ( )

Gets the question of a vote public

Returns
string The question of a vote

Here is the caller graph for this function:

getRangeID ( )

Gets the unique range ID from the vote public

Returns
string The unique range ID

Reimplemented from StudipObject.

Here is the caller graph for this function:

getRealStopdate ( )

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

Returns
integer The UNIX-timestamp with the real stopdate

Here is the call graph for this function:

getResultvisibility ( )

Gets the way how to show the results public

Returns
string The mode. See VOTE_RESULTS_*

Here is the caller graph for this function:

getStartdate ( )

Gets the start date public

Returns
integer Start date as a UNIX timestamp

Here is the caller graph for this function:

getState ( )

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

Returns
integer The State. See VOTE_*

Here is the caller graph for this function:

getStopdate ( )

Gets the stop date public

Returns
integer End date as a UNIX timestamp.

Here is the caller graph for this function:

getTimespan ( )

Gets the timespan public

Returns
integer The timespan in days

Here is the caller graph for this function:

getTitle ( )

Gets the title of a vote public

Returns
string The title of a vote

Here is the caller graph for this function:

getVoteID ( )

Gets the unique ID from the vote public

Returns
string The unique ID

Here is the caller graph for this function:

isActive ( )

Checks whether the vote is active public

Returns
boolean YES if vote is active
isAnonymous ( )

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

Returns
boolean YES if vote is not linked with a user

Here is the caller graph for this function:

isChangeable ( )

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

Returns
boolean YES if it´s allowed to change the answer

Here is the caller graph for this function:

isInUse ( )

Check whether a user had already used this vote public

Returns
bollean YES if a user had already used the vote

Here is the caller graph for this function:

isMultiplechoice ( )

Checks whether multiple choice is allowed public

Returns
boolean If multiple choice is allowed -> YES

Here is the caller graph for this function:

isNew ( )

Checks whether the vote is new public

Returns
boolean YES if vote is new

Here is the caller graph for this function:

isStopped ( )

Checks whether the vote is stopped public

Returns
boolean YES if vote is stopped

Here is the caller graph for this function:

isVisible ( )

Checks whether the vote is visible public

Returns
boolean YES if vote is visible

Here is the caller graph for this function:

readVote ( )

Loads an old vote (internal!) private

Exceptions
error

Reimplemented in TestVote.

Here is the call graph for this function:

Here is the caller graph for this function:

setAnonymous (   $anonymous)

Defines whether the vote is to be linked with a user 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 (   $answerArray)

Sets the answers 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 (   $authorID)

Sets the unique author ID from the vote public

Parameters
string$authorIDThe unique author ID

Reimplemented from StudipObject.

Here is the caller graph for this function:

setChangeable (   $changeable)

Defines whether it´s allowed for a user to change his/her answer 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 (   $timestamp)

Sets the change date (internal!) 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 (   $timestamp)

Sets the create date (internal!) 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 (   $isInUse)

Sets isInUse (internal!) private

Parameters
integer$isInUseYES / NO

Here is the call graph for this function:

Here is the caller graph for this function:

setMultiplechoice (   $multiplechoice)

Defines whether multiple choice is allowed 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 (   $namesvisibility)

Defines whether the names of participants will be publicly visible 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 (   $question)

Sets the question of a vote 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 (   $rangeID)

Sets the unique range ID from the vote public

Parameters
string$rangeIDThe unique range ID

Reimplemented from StudipObject.

Here is the caller graph for this function:

setResultvisibility (   $mode)

Sets the way how to show the results 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 (   $timestamp)

Sets the start date 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 (   $state)

Sets the state (internal!) private

Parameters
integer$stateThe state of the vote. See VOTE_*
Exceptions
error

Here is the caller graph for this function:

setStopdate (   $timestamp)

Sets the stop date 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 (   $seconds)

Sets the timespan 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 (   $title)

Sets the title of a vote 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 (   $objectID)

Sets the unique ID from the vote public

Parameters
string$objectIDThe unique ID
sortVoteAnswerarray (   $a,
  $b 
)

Sorts the answerarray

Parameters
array$afirst answerarray
array$bsecond answerarray private
sortVoteAnswers ( )

Sorts the answerarray public

Vote (   $oldVoteID = "")

Constructor public

Parameters
string$oldVoteIDThe ID of an existing vote
Exceptions
error

Here is the call graph for this function:

Here is the caller graph for this function:

Field Documentation

boolean $anonymous

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

array $answerArray

The possible anwers of the vote. private

string $authorID

The unique userID of the author of the vote private

boolean $changeable

Defines whether it is allowed to change the answers private

integer $changedate

Time of last change. Is set automatically. private

integer $creationdate

Time of creation. Is set automatically. private

boolean $isInUse

Defines whether a user had already used this vote private

boolean $multiplechoice

Defines whether multiple choice is allowed. private

integer $namesvisibility

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

integer $objectID

The unique ID of the vote private

string $question

The question of the vote. private

string $rangeID

The unique range ID of the vote private

integer $resultvisibility

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

integer $startdate

Startdate private

string $state

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

integer $stopdate

Stopdate private

integer $timespan

timespan private

string $title

The title of the vote. private

integer $visible

Defines whether the vote is visible or not private

object VoteDB $voteDB

Holds the VoteDB object public


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