If I've got a class representing use of one table during my database inside a class:table relationship, in order to hide table particulars in a single class. But every helpful application I must query several tables. How do i accomodate this while using class:table design?

There's a few different methods for you to accomplish this, however, which you select really is dependent in your conditions.

1) Break the bond involving the objects as well as your database

Write your objects to possess no reference to your database tables. First normalise your database tables, then, take a look at the way the user of the application will communicate with your computer data. Model the information to things, try not to tie each resist the table (ie having a Zend_DB_Table_Abstract class)

After you have established your objects, then write mapper classes which map your objects to the appropriate tables inside your database. Fundamental essentials classes which extend Zend_DB_Table (if appropriate).

You are able to handle joins in 2 ways, either map the joins with the Zend_DB_Table relationship functionallity, or, (IMHO a better option) only use Zend_DB_Choose to create the appropriate techniques in your your mapper class.

So you have then got two classes (most likely per table, although not always)

Person PersonMapper

Inside your code, when you wish to utilize some objects, either produce a new object

$person = new Person();
$person->setName('andrew taylor');

Then write pass it towards the mapper in order to save it:

$personMapper = new PersonMapper();

Or, get it done another way:

$personMapper = new PersonMapper();
$person = personMapper->load(29);

$person->setName('joe bloggs');

The next phase on came from here will be a collection class in line with the SPL:

$personList = $personMapper->loadAllMen();

foreach($personList AS $person) {

 echo $person->getName();

Where $personMapper->loadAllMen() is a technique like:

$select = $this->select();
$select=>where('gender = "Male"');
$zendDbRows = this->fetchAll($select);

return new PersonList($zendDbRows);

2) MySQL Sights

For those who have lots of became a member of tables where there's one row per join, so, you are joining customer information according to an id inside your orders table, and you are doing the work read-only (so you won't want to update any information with the Zend_DB_Table adaptor) you make your normalised tables, then, just one view over the top. The vista handles the joins behind the curtain so through Zend it feels as though you are hooking up to some single table.

You will find some caveats with this particular, MySQL sights will have some performance problems (and that's why it is best on single row FK joins), and, they are strictly read only.

Exactly what do you mean by

But every helpful application I must query several tables.