Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

Public Member Functions | Public Attributes | List of all members
eZPoll Class Reference

## Public Member Functions
| __construct ( $id=-1)
| store ()
| delete ()
| get ( $id=-1)
| getAll ()
| getAllActive ()
| id ()
| name ( $html=true)
| description ( $html=true)
| isEnabled ()
| isClosed ()
| showResult ()
| anonymous ()
| mainPoll ()
| setName ( $value)
| setDescription ( $value)
| setIsEnabled ( $value)
| setIsClosed ( $value)
| setShowResult ( $value)
| setAnonymous ( $value)
| totalVotes ()
| setMainPoll ( $poll)
& | forum ()

## Public Attributes
| $ID
| $Name
| $Description
| $IsEnabled
| $IsClosed
| $ShowResult
| $Anonymous

## Detailed Description

! eZPoll The eZPoll class handles the options for polls.

The eZPoll class handles poll options. The class has function for storing and fetching from the database.

Example code:

// Create a new poll object.
$poll = new eZPoll();
$poll->setName( "Politics" );
$poll->setDescription( "What do you think about Carl I. Hagen" );
// Stores the poll information into the database.
$poll->store();
// Fetch all the poll information from the database.
$poll->getAll();
// Print out all the polls
foreach( $pollArray as pollItem )
{
print( "Poll: " . $pollItem->name() . "<br>" );
}
$poll
$poll
Definition: admin/pollist.php:114
eZPoll
Definition: ezpoll.php:64
$pollArray
$pollArray[]
Definition: ezpoll/user/result.php:59

See also
  eZPollChoice eZVote

Definition at line 63 of file ezpoll.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZPoll::__construct | ( |  | $id = `-1` | ) |

Constructor a new eZPoll object. Retrieves the data from the database if a valid id is given as an argument.

Definition at line 69 of file ezpoll.php.

References $id, and $ID.

## Member Function Documentation

## ◆ anonymous()

eZPoll::anonymous | ( |  | ) |

Returns the Anonymous.

Definition at line 289 of file ezpoll.php.

## ◆ delete()

eZPoll::delete | ( |  | ) |

Deletes a eZPol object from the database.

Definition at line 135 of file ezpoll.php.

References $db, and eZDB\globalDatabase().

## ◆ description()

eZPoll::description | ( |  | $html = `true` | ) |

Returns the poll description.

Definition at line 245 of file ezpoll.php.

References $Description.

## ◆ forum()

& eZPoll::forum | ( |  | ) |

Returns the forum for the poll.

Definition at line 411 of file ezpoll.php.

References $db, $forum, $res, and eZDB\globalDatabase().

## ◆ get()

eZPoll::get | ( |  | $id = `-1` | ) |

Fetches the poll object from the database.

Definition at line 152 of file ezpoll.php.

References $db, $id, $ret, eZDB\globalDatabase(), and Name.

## ◆ getAll()

eZPoll::getAll | ( |  | ) |

Fetches the poll id from the database. And returns a array of eZPoll objects.

Definition at line 184 of file ezpoll.php.

References $db, $i, and eZDB\globalDatabase().

## ◆ getAllActive()

eZPoll::getAllActive | ( |  | ) |

Fetches the poll id from the database where active=true. And returns a array of eZPoll objects.

Definition at line 204 of file ezpoll.php.

References $db, $i, and eZDB\globalDatabase().

## ◆ id()

eZPoll::id | ( |  | ) |

Returns the id of the poll.

Definition at line 225 of file ezpoll.php.

References $ID.

## ◆ isClosed()

eZPoll::isClosed | ( |  | ) |

Returns the isClosed.

Definition at line 267 of file ezpoll.php.

## ◆ isEnabled()

eZPoll::isEnabled | ( |  | ) |

Returns the isEnabled.

Definition at line 256 of file ezpoll.php.

## ◆ mainPoll()

eZPoll::mainPoll | ( |  | ) |

Returns the main poll as a eZPoll object.

False is returned if no poll is set as main poll.

Definition at line 303 of file ezpoll.php.

References $db, $ret, and eZDB\globalDatabase().

## ◆ name()

eZPoll::name | ( |  | $html = `true` | ) |

Returns the name of the poll.

Definition at line 234 of file ezpoll.php.

References $Name, and Name.

## ◆ setAnonymous()

eZPoll::setAnonymous | ( |  | $value | ) |

Sets the anonymous of the poll.

Definition at line 370 of file ezpoll.php.

## ◆ setDescription()

eZPoll::setDescription | ( |  | $value | ) |

Sets the description of the poll.

Definition at line 329 of file ezpoll.php.

## ◆ setIsClosed()

eZPoll::setIsClosed | ( |  | $value | ) |

Sets the isclosed of the poll.

Definition at line 348 of file ezpoll.php.

## ◆ setIsEnabled()

eZPoll::setIsEnabled | ( |  | $value | ) |

Sets the isenabled of the poll.

Definition at line 337 of file ezpoll.php.

## ◆ setMainPoll()

eZPoll::setMainPoll | ( |  | $poll | ) |

Sets the active poll to the current poll.

Definition at line 393 of file ezpoll.php.

References $db, $poll, and eZDB\globalDatabase().

## ◆ setName()

eZPoll::setName | ( |  | $value | ) |

Sets the name of the poll.

Definition at line 321 of file ezpoll.php.

References Name.

## ◆ setShowResult()

eZPoll::setShowResult | ( |  | $value | ) |

Sets the showresult of the poll.

Definition at line 359 of file ezpoll.php.

## ◆ showResult()

eZPoll::showResult | ( |  | ) |

Returns the ShowResult.

Definition at line 278 of file ezpoll.php.

## ◆ store()

eZPoll::store | ( |  | ) |

Stores a eZPoll object to the database.

Definition at line 81 of file ezpoll.php.

References $db, $name, $res, eZDB\globalDatabase(), and Name.

## ◆ totalVotes()

eZPoll::totalVotes | ( |  | ) |

Fetches the total number of votes for the poll.

Definition at line 381 of file ezpoll.php.

References $db, and eZDB\globalDatabase().

## Member Data Documentation

## ◆ $Anonymous

eZPoll::$Anonymous

Definition at line 463 of file ezpoll.php.

## ◆ $Description

eZPoll::$Description

Definition at line 459 of file ezpoll.php.

Referenced by description().

## ◆ $ID

eZPoll::$ID

Definition at line 457 of file ezpoll.php.

Referenced by __construct(), and id().

## ◆ $IsClosed

eZPoll::$IsClosed

Definition at line 461 of file ezpoll.php.

## ◆ $IsEnabled

eZPoll::$IsEnabled

Definition at line 460 of file ezpoll.php.

## ◆ $Name

eZPoll::$Name

Definition at line 458 of file ezpoll.php.

Referenced by name().

## ◆ $ShowResult

eZPoll::$ShowResult

Definition at line 462 of file ezpoll.php.

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

- ezpoll.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.