Nice, but I have one more question:

If you have three tables, Users, UserAssociationWithJobs, Jobs... there is a
way to simple connect this tables for add, edit and delete actions?

Cause a User could have one or more jobs, and we have a table with the
possible jobs... and if you would like to add, edit and delete using SQL and
some php you could, but with ZF there is easier or similar ways??

best regards,

José de Menezes

2007/5/4, Bill Karwin <[EMAIL PROTECTED]>:

Actually, all you need for the table relationships to work is the
$_referenceMap in the dependent table's class definition.

The $_dependentTables variable is optional.  This is needed only if you
want to perform cascading UPDATE and DELETE operations in PHP code.  This is
not needed if you use constraints in your database to perform referential
integrity.  I recommend utilizing database constraints, it's safer and gives
better performance.

Regards,
Bill Karwin

> -----Original Message-----
> From: Maurice Fonk [mailto:[EMAIL PROTECTED]
> Sent: Friday, May 04, 2007 5:23 PM
> To: José de Menezes Soares Neto
> Cc: [email protected]
> Subject: Re: [fw-general] Working with two or more tables
>
> Hi again!
>
> Have a look at
> http://framework.zend.com/manual/en/zend.db.table.relationship
> s.html . I know it seems complicated at first, but you'll
> learn to appreciate it quickly. For your example, I could
> imagine that the table userinfo depends on the table user, so
> you'd put:
>
> protected $_dependentTables = array('Userinfo');
>
> in the class definition for User. Then you could use the
> magic function:
>
> $user->findUserinfo()
>
> on a User Row.
>
> MF
>
> José de Menezes Soares Neto wrote:
> > Hi again my friends!
> >
> > Now, I need to work with two or more tables, each table has some
> > information I need.
> > For example, table USERS has the users, but I need too
> table USERINFO,
> > which have the user information...
> >
> > I created a class that extends Zend_Db_Table_Abstract:
> >
> > class Users extends Zend_Db_Table_Abstract {
> >     protected $_name = 'users';
> > }
> >
> > But, I would like to manage more tables, and get flexibility to
> > combine then... these kind of things...
> >
> > Best regards,
> >
> > José
>
>
> --
> Maurice Fonk
>
> [EMAIL PROTECTED]
> http://naneau.nl/
>
> Scio me nihil scire
>
>

Reply via email to