You rock Thanks :D :D !!!

On Jan 15, 5:37 pm, John Andersen <j.andersen...@gmail.com> wrote:
> Ok, got it now!
> It is the table name "data" that make CakePHP fail in the model in the
> function getColumnType!
>
> This function is also used when asking for the table column type and
> when your happen to have a table named "data", this statement gives
> the wrong result!
>
> [code]
> if ($model != $this->alias && isset($this->{$model})) {
> [/code]
>
> Normally the last part will check whether the model exists or not, but
> when asked for the table column type, then the $model contains the
> table name, not a model name, thus asking if $this->data isset - and
> as we know, it is!
> And thus this function tries to return a wrong result!
>
> Conclusion: Do not name your table "data" :)
>
> Enjoy,
>    John
>
> On Jan 15, 4:30 pm, MrDevin <mr.de...@gmail.com> wrote:
>
>
>
> > You understand correctly.
>
> > WOW! thanks for putting so much effort in to my problem!
>
> > On Jan 15, 3:06 pm, John Andersen <j.andersen...@gmail.com> wrote:
>
> > > Can I understand it, that you have a table named "data", for which is
> > > defined a model named Datum?
> > > If yes, then I am trying to do the same now, and want to see what
> > > happens in case of a saveAll after an edit operation.
> > > Enjoy,
> > >    John
>
> > > On Jan 15, 3:20 pm, MrDevin <mr.de...@gmail.com> wrote:
>
> > > > i screwed up writing that
>
> > > > "Thanks for your patience "
>
> > > > is supposed to be on the end
>
> > > > and have a period.
>
> > > > :)
>
> > > > On Jan 15, 2:19 pm, MrDevin <mr.de...@gmail.com> wrote:
>
> > > > > sorry for the confusion.
>
> > > > > the following code was from my schema snapshot schema_5.php I
> > > > > believe.
> > > > > This is only used to to make sure my tables in MYSQL are structured
> > > > > correctly
> > > > > and not actively running anywhere.
>
> > > > > [code snippet]
> > > > > //this is from my latest schema snapshot
> > > > >   var $data = array(
> > > > >     'id' => array('type' => 'integer', 'null' => false, 'default' =>
> > > > > NULL, 'key' => 'primary'),
> > > > > [/code snippet]
>
> > > > > I should also point out that the "add" method uses the same controller
> > > > > and also uses saveAll(); with no problems.
>
> > > > > Thanks for your patience
> > > > > This makes me believe that having a table called "data" is not a
> > > > > problem, or do I have this wrong?
>
> > > [snip]
Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to