Table (class)

Class Table

Represents a single database table.

Exposes methods for retrieving data out of it, and manages the associations this table has to other tables. Multiple instances of this class can be created for the same database table with different aliases, this allows you to address your database structure in a richer and more expressive way.

Retrieving data

The primary way to retrieve data is using Table::find(). See that method for more information.

Dynamic finders

In addition to the standard find($type) finder methods, CakePHP provides dynamic finder methods. These methods allow you to easily set basic conditions up. For example to filter users by username you would call

$query = $users->findByUsername('mark');

You can also combine conditions on multiple fields using either Or or And:

$query = $users->findByUsernameOrEma