Finding saved records

The "find" method return an instance of "PorteIterator" which can be manipulated like an iteration of records. The method is available in "PorteRecord" and "PorteTable" objects.

Available options

The properties available in the options array are:

Exemples

Exemples on using the find method


// return and array of users based on a where query
$user->find('username=? AND password=?',array(
  'my username',
  'my password'
));
// return and array of users based on options
$user->find(array(
  'order_by'=>'date_of_creation',
  'direction'=>'asc'
));
// return and array of users based on a where query and options
$user->find('group_id=?',array(4),array(
  'order_by'=>'date_of_creation',
  'direction'=>'asc'
));
    

Open Source Object Relational Mapping in PHP

Download Porte 0.2.1