[fixed a typo in prev reply...]

Ok, for all the noobs out there (like me at the moment!) this is one
way to make it work...

In your model, you need to specify the association between the models:
(in MyModel)

class MyModel extends AppModel
{
        var $name = 'MyModel;
        var $hasMany = 'SomeModel';

}

(in MyModelController)

function add()
{
    $this->set(
            'myVariable',
            $this->MyModel->SomeModel->generateList(
                    $conditions = null,
                    $order = null,
                    $limit = null,
                    $keyPath = '{n}.SomeModel.id',
                    $valuePath = '{n}.SomeModel.datafield' )
    );

    // Do add processing...

}

Then you get what you expect...
I'm still not 100% clear on how the associations behave in comparison
to the database table relations that I'm accustomed to with MySQL, but
hopefully it'll click soon...


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to