Class Scry_Driver_sql

Description

Scry_Driver_sql Class

$Horde: scry/lib/Driver/sql.php,v 1.69 2007/06/12 16:44:40 chuck Exp $

Copyright 2003-2007 The Horde Project (http://www.horde.org/)

See the enclosed file COPYING for license information (GPL). If you did not receive this file, see http://www.fsf.org/copyleft/gpl.html.

Located in /lib/Driver/sql.php (line 15)

Scry_Driver
   |
   --Scry_Driver_sql
Variable Summary
 DB $_db
Method Summary
 Scry_Driver_sql Scry_Driver_sql ( $params)
 boolean concludePoll (integer $poll_id)
 array countPolls ([integer $poll_id = null], [integer $filter = null])
 boolean deletePoll (integer $poll_id)
 boolean enablePoll (integer $poll_id, integer $enabled)
 array getPolls ([integer $poll_id = null], [integer $filter = null], [integer $from = 0], [integer $count = 0])
 void getVotes ([ $poll_filter = null])
 array getVotesLog (integer $poll_id)
 void getWhoChoseWhat ( $poll_id)
 void hasVoted ( &$poll, [ $identifier = null], integer $poll_id, string $vote_identifier)
 void initialise ()
 array _buildPollsQuery ([integer $poll_id = null], [integer $filter = null], [boolean $count = false])
 void _logVote ( $poll,  $vote)
 void _savePoll ( &$info)
Variables
DB $_db (line 22)

Database object.

Inherited Variables

Inherited from Scry_Driver

Scry_Driver::$_params
Methods
Constructor Scry_Driver_sql (line 24)
Scry_Driver_sql Scry_Driver_sql ( $params)
  • $params
concludePoll (line 244)

Conclude voting on a poll.

  • return: True on success, otherwise PEAR error.
boolean concludePoll (integer $poll_id)
  • integer $poll_id: The poll id of the poll to conclude.
countPolls (line 198)

Return the number of polls

  • return: The poll data.
array countPolls ([integer $poll_id = null], [integer $filter = null])
  • integer $poll_id: The poll id of the poll to check.
  • integer $filter: Filter for only a certain group of polls.
deletePoll (line 267)

Deletes a poll and all of its vote log from the database.

  • return: True on success, otherwise PEAR error.
boolean deletePoll (integer $poll_id)
  • integer $poll_id: The poll id of the poll to delete.
enablePoll (line 313)

Toggles the enabled state of a poll.

  • return: True on success, otherwise PEAR error.
boolean enablePoll (integer $poll_id, integer $enabled)
  • integer $poll_id: The poll id of the poll to toggle.
  • integer $enabled: The new enabled state to set.
getPolls (line 108)

Fetches the poll data. If a poll id is passed will fetch only one poll, otherwise if the filter is set will fetch a subset of polls. If none of these are set then the whole list of polls will be returned.

  • return: The poll data.
array getPolls ([integer $poll_id = null], [integer $filter = null], [integer $from = 0], [integer $count = 0])
  • integer $poll_id: The poll id of the poll to check.
  • integer $filter: Filter for only a certain group of polls.
  • integer $from: The poll to start listing at.
  • integer $count: The number of polls to return.
getVotes (line 407)
void getVotes ([ $poll_filter = null])
  • $poll_filter
getVotesLog (line 479)

Fetches the full poll voting log for use when exporting the log to a file. The array keys will be set according to locale settings.

  • return: The vote log data.
array getVotesLog (integer $poll_id)
  • integer $poll_id: The poll id of the poll vote log to fetch.
getWhoChoseWhat (line 502)
void getWhoChoseWhat ( $poll_id)
  • $poll_id
hasVoted (line 335)

Checks to see if a user has already voted this poll.

void hasVoted ( &$poll, [ $identifier = null], integer $poll_id, string $vote_identifier)
  • integer $poll_id: The poll id of the poll to check.
  • string $vote_identifier: The parameter to be used to check the identity of the voter.
  • &$poll
  • $identifier
initialise (line 532)
void initialise ()
_buildPollsQuery (line 215)

Creates a SQL query for selecting or counting polls.

  • return: The poll data.
array _buildPollsQuery ([integer $poll_id = null], [integer $filter = null], [boolean $count = false])
  • integer $poll_id: The poll id of the poll to check.
  • integer $filter: Filter for only a certain group of polls.
  • boolean $count: Just count polls. Defaults to false.
_logVote (line 373)
void _logVote ( $poll,  $vote)
  • $poll
  • $vote
_savePoll (line 30)
void _savePoll ( &$info)
  • &$info

Inherited Methods

Inherited From Scry_Driver

 Scry_Driver::Scry_Driver()
 Scry_Driver::factory()
 Scry_Driver::isEditable()
 Scry_Driver::isOpen()
 Scry_Driver::isVotable()
 Scry_Driver::logVote()
 Scry_Driver::savePoll()
 Scry_Driver::singleton()

Documentation generated on Sun, 30 Jan 2011 05:37:10 +0000 by phpDocumentor 1.4.3