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

Public Member Functions

 setVote (&$vote)
 
 __construct ()
 
 getNewVotes ($rangeID)
 
 getActiveVotes ($rangeID)
 
 getStoppedVisibleVotes ($rangeID)
 
 getStoppedVotes ($rangeID)
 
 getNewUserVotes ($authorID, $rangeID=NULL)
 
 getActiveUserVotes ($authorID, $rangeID=NULL)
 
 getStoppedUserVotes ($authorID, $rangeID=NULL)
 
 removeVote ($voteID)
 
 getVote ($voteID)
 
 isExistant ($voteID)
 
 isAssociated ($voteID, $userID)
 
 hasanyoneparticipated ($voteID, $anonymous=NO)
 
 getNumberUserVoted ()
 
 getRangename ($rangeID)
 
 getAuthorUsername ($authorID)
 
 getAuthorRealname ($authorID)
 
 startVote ($voteID, $state, $startdate, $stopdate, $timespan)
 
 stopVote ($voteID, $state, $stopdate)
 
 continueVote ($voteID, $startdate, $stopdate)
 
 restartVote ($voteID, $startdate, $stopdate, $anonymous)
 
 setVisible ($voteID, $state)
 
 startWaitingVotes ($rangeID)
 
 writeVote ($voteID, $authorID, $rangeID, $title, $question, $state, $startTime, $endTime, $timespan, $mkdate, $chdate, $resultvisibility, $namesvisibility, $multiplechoice, $anonymous, $answerarray, $changeable, $co_visibility=NULL, $type)
 
 participate ($voteID, $userID, $answerArray, $isAnonymous, $changeable=NULL)
 
 getAssociatedUsers ($answer_id)
 
 getType ($voteID)
 
 search_range ($search_str)
 
 isExistant2 ()
 
 isAssociated2 ($userID=NULL)
 
 writeVote2 ()
 
- 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)
 

Data Fields

 $vote
 
- Data Fields inherited from StudipObject
 $objectID
 
 $authorID
 
 $rangeID
 
- Data Fields inherited from AuthorObject
 $errorArray
 
 $authorEmail
 
 $authorName
 
 $instanceof
 

Constructor & Destructor Documentation

◆ __construct()

__construct ( )

Member Function Documentation

◆ continueVote()

continueVote (   $voteID,
  $startdate,
  $stopdate 
)

Continues a stopped vote by setting it's state to active @access public

Parameters
voteIDVoteID of the specified vote
$startdateNew date, when the vote starts
$stopdateNew date, when the vote stops
Here is the call graph for this function:

◆ getActiveUserVotes()

getActiveUserVotes (   $authorID,
  $rangeID = NULL 
)

Gets active votes from a specified user

@access public

Parameters
string$userIDThe ID of the demanding user
Returns
array All active voteID's
Here is the call graph for this function:

◆ getActiveVotes()

getActiveVotes (   $rangeID)

Gets the active votes in the specified rangeID

@access public

Parameters
string$rangeIDThe specified rangeID
Returns
array All active voteID's
Here is the call graph for this function:

◆ getAssociatedUsers()

getAssociatedUsers (   $answer_id)

Returns the users having voted with a specific answer @access public

Parameters
answer_idThe id of the specific answer
Here is the call graph for this function:

◆ getAuthorRealname()

getAuthorRealname (   $authorID)

Gets the real name from the owner of the vote @access public

Returns
string The real name ("name surname")
Here is the call graph for this function:

◆ getAuthorUsername()

getAuthorUsername (   $authorID)

Gets the username from the owner of the vote @access public

Returns
string The username
Here is the call graph for this function:

◆ getNewUserVotes()

getNewUserVotes (   $authorID,
  $rangeID = NULL 
)

Gets new votes from a specified user

@access public

Parameters
string$userIDThe ID of the demanding user
Returns
array All new voteID's
Here is the call graph for this function:

◆ getNewVotes()

getNewVotes (   $rangeID)

Gets the new votes in the specified rangeID

@access public

Parameters
string$rangeIDThe specified rangeID
Returns
array All new voteID's
Here is the call graph for this function:

◆ getNumberUserVoted()

getNumberUserVoted ( )

Gets the number of users which used the vote @access public

Returns
integer The number of users which used the vote
Here is the call graph for this function:

◆ getRangename()

getRangename (   $rangeID)

Gets the name of the range from the vote @access public

Returns
string The name of the range
Here is the call graph for this function:

◆ getStoppedUserVotes()

getStoppedUserVotes (   $authorID,
  $rangeID = NULL 
)

Gets stopped votes from a specified user

@access public

Parameters
string$userIDThe ID of the demanding user
Returns
array All stopped voteID's
Here is the call graph for this function:

◆ getStoppedVisibleVotes()

getStoppedVisibleVotes (   $rangeID)

Gets stopped votes in the specified rangeID that are visible to authors

@access public

Parameters
string$rangeIDThe specified rangeID
Returns
array All stopped and visible voteID's
Here is the call graph for this function:

◆ getStoppedVotes()

getStoppedVotes (   $rangeID)

Gets stopped votes in the specified rangeID

@access public

Parameters
string$rangeIDThe specified rangeID
Returns
array All voteID's of stopped votes
Here is the call graph for this function:

◆ getType()

getType (   $voteID)

Returns the type of a specific vote

Parameters
string$voteIDId of the vote
Returns
mixed Either 'vote', 'test' or false if vote id is invalid
Here is the call graph for this function:

◆ getVote()

getVote (   $voteID)

Reads a specified vote from the DB and returns an array of it's params.

@access public

Parameters
string$voteIDspecified voteID
Returns
array $votearray Parameters of the Vote
Here is the call graph for this function:

◆ hasanyoneparticipated()

hasanyoneparticipated (   $voteID,
  $anonymous = NO 
)

Checks whether any user has participated in a specified vote @access public

Returns
boolean True if user had already used his/her vote
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isAssociated()

isAssociated (   $voteID,
  $userID 
)

Checks whether a user has participated in a specified vote @access public

Parameters
string$userIDThe unique user ID
Returns
boolean True if user had already used his/her vote
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isAssociated2()

isAssociated2 (   $userID = NULL)

Checks whether a special user or anyone has participated @access public

Parameters
string$userIDThe unique user ID
Returns
boolean True if user had already used his/her vote
Here is the call graph for this function:

◆ isExistant()

isExistant (   $voteID)

Checks wheather a vote with a specified ID already exists @access public

Parameters
specifiedVote ID
Returns
bool
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isExistant2()

isExistant2 ( )

Checks wheather a vote with a specified ID already exists (alex) @access public

Returns
Either YES or NO
Here is the call graph for this function:

◆ participate()

participate (   $voteID,
  $userID,
  $answerArray,
  $isAnonymous,
  $changeable = NULL 
)

Store a user's participation

Parameters
string$voteIDId of the vote
string$userIDId of the participating user
array$answerArrayArray containing the answers
boolean$isAnonymousIndicates where participation is anonymous
boolean$changeableIndiciates whether the user may change his answers
Here is the call graph for this function:

◆ removeVote()

removeVote (   $voteID)

Deletes a vote from the DB

@access public

Parameters
string$voteIDThe specified voteID
Here is the call graph for this function:

◆ restartVote()

restartVote (   $voteID,
  $startdate,
  $stopdate,
  $anonymous 
)

Restarts a vote setting all answercounters to 0 again @access public

Parameters
voteIDVoteID of the specified vote
$startdateNew date, when the vote starts
$stopdateNew date, when the vote stops
$anonymousIs the vote anonymous or not
Here is the call graph for this function:

◆ search_range()

search_range (   $search_str)

Searches a range? (TODO)

Parameters
string$search_strString to search
Returns
mixed
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setVisible()

setVisible (   $voteID,
  $state 
)

Sets the visibility of a vote to the new state @access public

Parameters
voteIDVoteID of the specified vote
$stateNew state
Here is the call graph for this function:

◆ setVote()

setVote ( $vote)

Set the vote object to be used

Parameters
$mixed$vote Vote object

◆ startVote()

startVote (   $voteID,
  $state,
  $startdate,
  $stopdate,
  $timespan 
)

Gets the real name from the owner of the vote @access public

Parameters
voteIDVoteID of the specified vote
$stateNew state of the vote
$startdateNew date, when the vote starts
$stopdateNew date, when the vote stops
$timespanA useless parameter
Here is the call graph for this function:

◆ startWaitingVotes()

startWaitingVotes (   $rangeID)

Starts all votes in dependency to their startdate

Parameters
string$rangeIDThe specified rangeID
Here is the call graph for this function:

◆ stopVote()

stopVote (   $voteID,
  $state,
  $stopdate 
)

Stopps an active vote by setting its state to 'stopped'. @access public

Parameters
voteIDVoteID of the specified vote
$stateNew state of the vote
$stopdateNew date, when the vote stops
Here is the call graph for this function:

◆ writeVote()

writeVote (   $voteID,
  $authorID,
  $rangeID,
  $title,
  $question,
  $state,
  $startTime,
  $endTime,
  $timespan,
  $mkdate,
  $chdate,
  $resultvisibility,
  $namesvisibility,
  $multiplechoice,
  $anonymous,
  $answerarray,
  $changeable,
  $co_visibility = NULL,
  $type 
)

Writes a new vote into the Database

@access public

Parameters
string$voteIDspecified voteID
string$autorIDID of the author
string$rangeIDspecified rangeID
string$titleTitle of the vote
string$questionQuestion of the vote
int$statestate of the vote
int$starttimeStarttime of the vote
int$endtimeEndtime of the vote
int$timeslice
int$creationTimeCreation time of thevote
int$changeTimeTime of last modifications
int$resultviewVisibility of the results
int$namesvisibilityVisibility of the participants
string$multianswerSingle or multianswering
string$anonymousDemocratic or totalitarian vote
array$answerArrayThe answers
string$co_visibilitycorrect answers visibility
string$type
Returns
boolean TRUE/FALSE Success of Insertion
Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeVote2()

writeVote2 ( )

Writes a new vote(not a test) into the database (neue Version von Alex) z.Z. noch unbenutzt (12.Aug.2003), jedoch getestet und funktionstüchtig @access public

Here is the call graph for this function:

Field Documentation

◆ $vote

Vote $vote

Holds an instance of a vote @access public


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