Stud.IP  2.0 Revision 48548
 All Data Structures Namespaces Files Functions Variables Pages
VoteDB Class Reference
Inheritance diagram for VoteDB:
Inheritance graph
Collaboration diagram for VoteDB:
Collaboration graph

Public Member Functions

 VoteDB ()
 setVote (&$vote)
 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

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

Member Function Documentation

continueVote (   $voteID,
  $startdate,
  $stopdate 
)

Continues a stopped vote by setting it's state to active 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 (   $authorID,
  $rangeID = NULL 
)

Gets active votes from a specified user

public

Parameters
string$userIDThe ID of the demanding user
Returns
array All active voteID's

Here is the call graph for this function:

getActiveVotes (   $rangeID)

Gets the active votes in the specified rangeID

public

Parameters
string$rangeIDThe specified rangeID
Returns
array All active voteID's

Here is the call graph for this function:

getAssociatedUsers (   $answer_id)

Returns the users having voted with a specific answer public

Parameters
answer_idThe id of the specific answer
getAuthorRealname (   $authorID)

Gets the real name from the owner of the vote public

Returns
string The real name ("name surname")
getAuthorUsername (   $authorID)

Gets the username from the owner of the vote public

Returns
string The username

Here is the call graph for this function:

getNewUserVotes (   $authorID,
  $rangeID = NULL 
)

Gets new votes from a specified user

public

Parameters
string$userIDThe ID of the demanding user
Returns
array All active voteID's

Here is the call graph for this function:

getNewVotes (   $rangeID)

Gets the new votes in the specified rangeID

public

Parameters
string$rangeIDThe specified rangeID
Returns
array All active voteID's

Here is the call graph for this function:

getNumberUserVoted ( )

Gets the number of users which used the vote public

Returns
integer The number of users which used the vote
getRangename (   $rangeID)

Gets the name of the range from the vote public

Returns
string The name of the range

Here is the call graph for this function:

getStoppedUserVotes (   $authorID,
  $rangeID = NULL 
)

Gets stopped votes from a specified user

public

Parameters
string$userIDThe ID of the demanding user
Returns
array All active voteID's

Here is the call graph for this function:

getStoppedVisibleVotes (   $rangeID)

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

public

Parameters
string$rangeIDThe specified rangeID
Returns
array All active voteID's

Here is the call graph for this function:

getStoppedVotes (   $rangeID)

Gets stopped votes in the specified rangeID

public

Parameters
string$rangeIDThe specified rangeID
Returns
array All voteID's of stopped votes

Here is the call graph for this function:

getType (   $voteID)
getVote (   $voteID)

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

public

Parameters
string$voteIDspecified voteID
Returns
array $votearray Parameters of the Vote

Here is the call graph for this function:

hasanyoneparticipated (   $voteID,
  $anonymous = NO 
)

Checks whether any user has participated in a specified vote public

Returns
boolean True if user had already used his/her vote

Here is the caller graph for this function:

isAssociated (   $voteID,
  $userID 
)

Checks whether a user has participated in a specified vote public

Parameters
string$userIDThe unique user ID
Returns
boolean True if user had already used his/her vote
isAssociated2 (   $userID = NULL)

Checks whether a special user or anyone has participated public

Parameters
string$userIDThe unique user ID
Returns
boolean True if user had already used his/her vote
isExistant (   $voteID)

Checks wheather a vote with a specified ID already exists public

Parameters
specifiedVote ID
Returns
TRUE or FALSE
isExistant2 ( )

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

Returns
YES or NO

Here is the caller graph for this function:

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

Here is the call graph for this function:

removeVote (   $voteID)

Deletes a vote from the DB

public

Parameters
string$voteIDThe specified voteID
restartVote (   $voteID,
  $startdate,
  $stopdate,
  $anonymous 
)

Restarts a vote setting all answercounters to 0 again 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_str)
setVisible (   $voteID,
  $state 
)

Sets the visibility of a vote to the new state public

Parameters
voteIDVoteID of the specified vote
$stateNew state

Here is the call graph for this function:

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

Gets the real name from the owner of the vote 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 (   $rangeID)

Starts all votes in dependency to their startdate

Parameters
string$rangeIDThe specified rangeID
stopVote (   $voteID,
  $state,
  $stopdate 
)

Stopps an active vote by setting its state to 'stopped'. 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:

VoteDB ( )

Constructor

public

Here is the call graph for this function:

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

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
booleanTRUE/FALSE Success of Insertion

Here is the call graph for this function:

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 public

Here is the call graph for this function:

Field Documentation

$db

Variable $db

public

Vote $vote

Holds an instance of a vote private


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