I can't get saveAll to work with habtm. (it's working in other
controllers tough)

The $saveArr looks like this :

Array
(
    [0] => Array
        (
            [Stockmovement] => Array
                (
                    [id] => 2040
                )

            [Stockmovesource] => Array
                (
                    [0] => Array
                        (
                            [id] => 3
                        )

                    [1] => Array
                        (
                            [id] => 2
                        )

                    [2] => Array
                        (
                            [id] => 1
                        )

                )

        )

)


This is the saveAll loop :

if (!empty($saveArr)) {
        foreach ($saveArr as $saveData) {
                debug($saveData);
                if ($this->Stockmovement->saveAll($saveData)) {
                        // all ok
                } else {
                        // error
                }
        }

Stockmovement HABTM Stockmovesource

!=> the 'stockmovement' id:2040 is already in the db, with 2
stockmovesources, so a 3th stockmovesource id:1 should be added...

Any idea what can be wrong ?

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