classUsersextendsZend_Db_Table_Abstract{protected $_name ='users';protected $_rowClass ='User';protected $_dependentTables = array ('UserMetadata','UserPassword');...classUserMetadataextendsZend_Db_Table_Abstract{protected $_name ='user_metadata';protected $_referenceMap = array ('Users'=> array ('columns'=>'user_id','refTableClass'=>'Users','refColumns'=>'id'));...classUserPasswordextendsZend_Db_Table_Abstract{protected $_name ='user_password';protected $_referenceMap = array ('Users'=> array ('columns'=>'user_id','refTableClass'=>'Users','refColumns'=>'id'));
Fetching data:
$id =//get your user id from somewhere
$users =newUsers();
$user = $users->fetchRow('id=?', $id);if($user->authMethod ==0){
$metadata = $user->findDependentRowset('UserMetadata')->current();}
or
$user = $users->fetchRow($users->select()->where('gender=?, 'M')
->order('email ASC');
... etc.
Inserting data:
$newRow = $users->fetchNew();
$newRow->email = me@domain.com;
$newRow->save();
or
$users =newUsers();
$data = array('email'=>'me@domain.com','firstname'=>'Me');
$users->insert($data);
Updating:
$user->email ='me@domain.org';
$user->save();
Deleting a row:
$user->delete();
Using transaction:
$db->beginTransaction();
$db->commit();
$db->rollback();