It think so:
post model:
var $hasMany = array(
'Attachment' => array(
'className' => 'Attachment',
'foreignKey' => 'post_id',
'dependent' => true,
)
);
attachment model:
var $belongsTo = array(
'Post' => array(
'className' => 'Post',
'foreignKey' => 'post_id',
),
);
On 8 Jun, 09:48, Jeremy Burns | Class Outfit
<[email protected]> wrote:
> Have you got your model associations set up correctly?
>
> Jeremy Burns
> Class Outfit
>
> [email protected]http://www.classoutfit.com
>
> On 8 Jun 2011, at 09:45, homem-arvore wrote:
>
>
>
>
>
>
>
> > $this->Post->saveAll($fakedata); does not work
>
> > $this->Post->Attachment->saveAll($fakedata); actually works
>
> > I think I'm almost there understanding how it works... My current
> > theory :P is that saveAll only saves multiple records they're related
> > data.
>
> > --
> > Our newest site for the community: CakePHP Video
> > Tutorialshttp://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > [email protected] For more options, visit this group
> > athttp://groups.google.com/group/cake-php
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others
with their CakePHP related questions.
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php