What I would suggest to you is to use bake generate your models,
controllers, and views.

Bake will auto-suggest what associations to have by looking at your
table structure.

Then have a look at the code it produces and massage the associations/
data retrieval to your liking.

Other than that, just keep trying - it took me a while to fully
understand the relationships and how to retrieve/save associations,
and I did it by analysing the code "bake" created.

Unfortunately I don't know of any resources which go into depth with
associations (and comparing to complex real-world relationships and
not just Post<->Tags, etc)

Adam

On Jan 8, 4:44 pm, Travis <[EMAIL PROTECTED]> wrote:
> Ok guys,
>
> I've been working on this project for a few days and still can't get
> my associations to work.  When I output debug($dataSet), and $dataSet
> = $this->Model->findAll() I only return data for the model I am
> using.  Here are a couple of my models .  Please let me know if there
> is someway that associations can be turned off, or if you see me
> following some non-standard convention.
>
> And I am on version 1.2.6311 beta.
>
> Thanks
>
> Travis
>
> class Customer extends AppModel {
>
>         var $name               = 'Customer';
>         var $hasMany    = 'Employee';
>         var $recursive  = 1;
>
> }
>
> class EmployeeModel extends AppModel
> {
>         var $name                       = 'Employee';
>         var $belongsTo          = 'Customer';
>         var $recursive          = 2;
>
> }
>
> class Transaction extends AppModel
> {
>
>         var $name                                       = "Transaction";
>         var $hasAndBelongsToMany        = 'Employee';
>         var $hasMany                            = 'OtherCosts';
>         var $hasOne                                     = 
> array('Trainer','Division');
>         var $recursive                          = 2;
>         var $actsAs = array('Bindable' => array('notices' => true));
>
> }
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to