Show:

Users.Vote Class

Extends Base.Users.Vote
Module: Users

Class representing 'Vote' rows in the 'Users' database
Represents a vote by a user for something

Constructor

Users.Vote

(
  • fields
)

Parameters:

  • fields Object

    The fields values to initialize table row as an associative array of {column: value} pairs

Methods

afterRemoveExecute

(
  • query
  • result
  • error
)

Commit or rollback transaction when deleting a vote

Parameters:

afterSaveExecute

(
  • query
  • result
  • error
)

Commit or rollback transaction when saving new vote

Parameters:

beforeRemoveExecute

(
  • query
)

Update total votes in Users.Total when removing a vote

Parameters:

beforeSaveExecute

(
  • query
  • modifiedFields
)

Update total votes in Users.Total when saving new vote

Parameters:

  • query Db.Query.Mysql
    The query being excecuted
  • modifiedFields Object
    The fields which are modified by query

setUp

()

The setUp() method is called the first time an object of this class is constructed.