.

DAOVotesaggregates Class Reference

Model class for Votes. More...

Inheritance diagram for DAOVotesaggregates:
DataObjectBase IDataObject IActionSource ISearchAdapter IDBTable IDBWhereHolder

List of all members.

Public Member Functions

  get_average ($precision=0)

Public Attributes

  $average
  $id
  $instance
  $modificationdate
  $numtotal

Protected Member Functions

  create_table_object ()

Detailed Description

Model class for Votes.

Votes can hold values from 0 to 100 (so they contain percents, actually)

Definition at line 7 of file votesaggregates.model.php.


Member Function Documentation

DAOVotesaggregates::create_table_object (  )  [protected]

Reimplemented from DataObjectBase.

Definition at line 15 of file votesaggregates.model.php.

00015                                                  {
00016             return new DBTable(
00017                 'votesaggregates',
00018                         array(
00019                                 new DBFieldInt('id', null, DBFieldInt::AUTOINCREMENT | DBFieldInt::UNSIGNED | DBFieldInt::NOT_NULL),
00020                                 new DBFieldInstanceReference('instance'), 
00021                                 new DBFieldFloat('average'),
00022                                 new DBFieldInt('numtotal'),
00023                                 new DBFieldDateTime('modificationdate', DBFieldDateTime::NOW, DBFieldDateTime::TIMESTAMP),
00024                         ),
00025                         'id'                    
00026             );
00027         }
DAOVotesaggregates::get_average ( precision = 0  ) 

Definition at line 29 of file votesaggregates.model.php.

00029                                                     {
00030                 $f = pow(10, $precision);
00031                 $ret = intval(ceil($this->average * $f)) / $f;
00032                 return $ret;
00033         }

Member Data Documentation

DAOVotesaggregates::$average

Definition at line 10 of file votesaggregates.model.php.

DAOVotesaggregates::$id

Definition at line 8 of file votesaggregates.model.php.

DAOVotesaggregates::$instance

Definition at line 9 of file votesaggregates.model.php.

DAOVotesaggregates::$modificationdate

Definition at line 12 of file votesaggregates.model.php.

DAOVotesaggregates::$numtotal

Definition at line 11 of file votesaggregates.model.php.


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