Re: SaveAll to save Parsed Array not working.

2009-04-22 Thread smithtrev...@googlemail.com

Thanks, how would I go about changing the index on the array then?

My array also looks slightly different from yours, and idea how to
change it to the same format as yours.

Cheers,
Ali

On Apr 20, 1:55 pm, schneimi michael.schne...@arcor.de wrote:
 Hi,

 when I use saveAll, my data looks like this:

 Array
 (
     [1] = Array
         (
             [Team] = Array
                 (   [name] = Arsenal
                     [id] = 7
                 )

         )

     [2] = Array
         (
             [Team] = Array
                 (
                     [name] = Aston Villa
                     [id] = 9
                 )

         )
 )

 Not sure if that's the reason, but this way it definitely works.

 I remember that it was important that the index starts with 1 (maybe
 not with the newest cake), so maybe yours work too and you just have
 to increase the index.

 Hope this helps,

 Michael

 smithtrev...@googlemail.com schrieb:

  Hello, I've parsed some XML, and am attempting to save it using the
  saveAll() method, however it does not save, give me an error message
  or anything like that. Just nothing happens. I think it thinks it is
  saving, I've tried test messages to appear if saving occurs, and they
  always appear.

  Here is the code I'm using to try and save:
   $xml = new XML($file);
   $xml = Set::reverse($xml);
   $success = $this-Team-saveAll($xml['Teams']);

  Here is an extract from the controller dump of the array that I'm
  trying to save...
              [useDbConfig] = default
              [useTable] = teams
              [displayField] = name
              [id] =
              [data] = Array
                  ( [Team] = Array
                          (   [0] = Array
                                  (   [name] = Arsenal
                                      [id] = 7
                                  )

                              [1] = Array
                                  (   [name] = Aston Villa
                                      [id] = 9
                                  )))

  Interestingly it saves if I attempt to save just one record. For
  example, if I try to remove one of the teams, and the [0] , [1]  or
  [n] disappears, to make this.

               ( [Team] = Array
                                 (   [name] = Arsenal
                                     [id] = 7
                                  )

  Any ideas why this isn't working?
  Thanks in advance for any help!
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: SaveAll to save Parsed Array not working.

2009-04-20 Thread schneimi

Hi,

when I use saveAll, my data looks like this:

Array
(
[1] = Array
(
[Team] = Array
(   [name] = Arsenal
[id] = 7
)

)

[2] = Array
(
[Team] = Array
(
[name] = Aston Villa
[id] = 9
)

)
)

Not sure if that's the reason, but this way it definitely works.

I remember that it was important that the index starts with 1 (maybe
not with the newest cake), so maybe yours work too and you just have
to increase the index.

Hope this helps,

Michael

smithtrev...@googlemail.com schrieb:
 Hello, I've parsed some XML, and am attempting to save it using the
 saveAll() method, however it does not save, give me an error message
 or anything like that. Just nothing happens. I think it thinks it is
 saving, I've tried test messages to appear if saving occurs, and they
 always appear.

 Here is the code I'm using to try and save:
  $xml = new XML($file);
  $xml = Set::reverse($xml);
  $success = $this-Team-saveAll($xml['Teams']);

 Here is an extract from the controller dump of the array that I'm
 trying to save...
 [useDbConfig] = default
 [useTable] = teams
 [displayField] = name
 [id] =
 [data] = Array
 ( [Team] = Array
 (   [0] = Array
 (   [name] = Arsenal
 [id] = 7
 )

 [1] = Array
 (   [name] = Aston Villa
 [id] = 9
 )))

 Interestingly it saves if I attempt to save just one record. For
 example, if I try to remove one of the teams, and the [0] , [1]  or
 [n] disappears, to make this.

  ( [Team] = Array
(   [name] = Arsenal
[id] = 7
 )

 Any ideas why this isn't working?
 Thanks in advance for any help!
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



SaveAll to save Parsed Array not working.

2009-04-19 Thread smithtrev...@googlemail.com

Hello, I've parsed some XML, and am attempting to save it using the
saveAll() method, however it does not save, give me an error message
or anything like that. Just nothing happens. I think it thinks it is
saving, I've tried test messages to appear if saving occurs, and they
always appear.

Here is the code I'm using to try and save:
 $xml = new XML($file);
 $xml = Set::reverse($xml);
 $success = $this-Team-saveAll($xml['Teams']);

Here is an extract from the controller dump of the array that I'm
trying to save...
[useDbConfig] = default
[useTable] = teams
[displayField] = name
[id] =
[data] = Array
( [Team] = Array
(   [0] = Array
(   [name] = Arsenal
[id] = 7
)

[1] = Array
(   [name] = Aston Villa
[id] = 9
)))

Interestingly it saves if I attempt to save just one record. For
example, if I try to remove one of the teams, and the [0] , [1]  or
[n] disappears, to make this.

 ( [Team] = Array
   (   [name] = Arsenal
   [id] = 7
)

Any ideas why this isn't working?
Thanks in advance for any help!
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---