Let's say I have a model Model1 with fields 'name' and 'date' and I
have a Model2 with field 'name'. Model1 is in relation 'hasMany' with
Model2. How should I use saveAll() method with "fieldList" parameter
if I only want to save all 'date' from Model1 and 'name' from Model2?
It looks like in "fieldList" array only fields' names without models'
names allowed i.e.
This will work:
$this->saveAll($data, array('fieldList' => array('date')));
but this won't:
$this->saveAll($data, array('fieldList' => array('date',
'Model2.0.name')));
this won't either:
$this->saveAll($data, array('fieldList' => array('date',
'Model2.name')));
> Let's say I have a model Model1 with fields 'name' and 'date' and I
> have a Model2 with field 'name'. Model1 is in relation 'hasMany' with
> Model2. How should I use saveAll() method with "fieldList" parameter
> if I only want to save all 'date' from Model1 and 'name' from Model2?
> It looks like in "fieldList" array only fields' names without models'
> names allowed i.e.
> This will work:
> $this->saveAll($data, array('fieldList' => array('date')));
> but this won't:
> $this->saveAll($data, array('fieldList' => array('date',
> 'Model2.0.name')));
On Fri, Nov 13, 2009 at 8:52 AM, mattalexx <mattal...@gmail.com> wrote:
> Any luck figuring this one out?
> On Nov 5, 3:15 am, Raph <ra...@epoczta.pl> wrote:
> > Hello,
> > Let's say I have a model Model1 with fields 'name' and 'date' and I
> > have a Model2 with field 'name'. Model1 is in relation 'hasMany' with
> > Model2. How should I use saveAll() method with "fieldList" parameter
> > if I only want to save all 'date' from Model1 and 'name' from Model2?
> > It looks like in "fieldList" array only fields' names without models'
> > names allowed i.e.
> > This will work:
> > $this->saveAll($data, array('fieldList' => array('date')));
> > but this won't:
> > $this->saveAll($data, array('fieldList' => array('date',
> > 'Model2.0.name')));
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscribe@googlegroups.com<cake-php%2Bunsubscribe@googlegroups.c om>
> .
> For more options, visit this group at
> http://groups.google.com/group/cake-php?hl=.
> On Fri, Nov 13, 2009 at 8:52 AM, mattalexx <mattal...@gmail.com> wrote:
> > Any luck figuring this one out?
> > On Nov 5, 3:15 am, Raph <ra...@epoczta.pl> wrote:
> > > Hello,
> > > Let's say I have a model Model1 with fields 'name' and 'date' and I
> > > have a Model2 with field 'name'. Model1 is in relation 'hasMany' with
> > > Model2. How should I use saveAll() method with "fieldList" parameter
> > > if I only want to save all 'date' from Model1 and 'name' from Model2?
> > > It looks like in "fieldList" array only fields' names without models'
> > > names allowed i.e.
> > > This will work:
> > > $this->saveAll($data, array('fieldList' => array('date')));
> > > but this won't:
> > > $this->saveAll($data, array('fieldList' => array('date',
> > > 'Model2.0.name')));
> > You received this message because you are subscribed to the Google Groups
> > "CakePHP" group.
> > To post to this group, send email to cake-php@googlegroups.com.
> > To unsubscribe from this group, send email to
> > cake-php+unsubscribe@googlegroups.com<cake-php%2Bunsubscr...@googlegroups.c om>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/cake-php?hl=.
> > On Fri, Nov 13, 2009 at 8:52 AM, mattalexx <mattal...@gmail.com> wrote:
> > > Any luck figuring this one out?
> > > On Nov 5, 3:15 am, Raph <ra...@epoczta.pl> wrote:
> > > > Hello,
> > > > Let's say I have a model Model1 with fields 'name' and 'date' and I
> > > > have a Model2 with field 'name'. Model1 is in relation 'hasMany' with
> > > > Model2. How should I use saveAll() method with "fieldList" parameter
> > > > if I only want to save all 'date' from Model1 and 'name' from Model2?
> > > > It looks like in "fieldList" array only fields' names without models'
> > > > names allowed i.e.
> > > > This will work:
> > > > $this->saveAll($data, array('fieldList' => array('date')));
> > > > but this won't:
> > > > $this->saveAll($data, array('fieldList' => array('date',
> > > > 'Model2.0.name')));
> > > You received this message because you are subscribed to the Google Groups
> > > "CakePHP" group.
> > > To post to this group, send email to cake-php@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > > cake-php+unsubscribe@googlegroups.com<cake-php%2Bunsubscr...@googlegroups.c om>
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/cake-php?hl=.