This one has me stumped.
I'm using Innodb storage engine, cakephp 1.3
and doing the following:
function withdraw() {
// dynamically associate Event with EventTransactions
$this->Event->bindModel(
array('hasOne' => array('EventTransaction'))
);
$this->set('InventoryTypes',
$this->Event->EventTransaction->InventoryType->find('list'));
if (!empty($this->data)) {
// check the result
$this->set('test', $this->data);
if ($this->Event->validates()) {
$this->set('validated', 'validated');
}
$this->Event->saveAll($this->data);
}
}
the validates check proves the model validates, however the transaction
seems to start, then I get nothing - No errors, no records are saved...
I'm not enforcing foreign key constraints... I'm simply trying to store a
record in the events table, with a dynamically associated entry in the
event_transactions table.
What have I done wrong here?
Test view is:
<h2>Withdraw PI Material from POS Hanger</h2>
<?php
echo $this->Form->create('Event', array('url' => array('controller' =>
'transactions', 'action' => 'withdraw')));
echo $this->Form->hidden('Event.user_id', array('value' => 1));
echo $this->Form->hidden('Event.event_type_id', array('value' => 1));
echo $this->Form->Select('EventTransaction.inventory_type_id',
$InventoryTypes);
echo $this->Form->Input('EventTransaction.amount');
echo $this->Form->end('Submit');
pr($test);
pr($validated);
?>
output in the SQL query table at the bottom of the page is:
NrQueryErrorAffectedNum. rowsTook (ms) 1DESCRIBE `events`
661 2DESCRIBE `event_types`
4411 3DESCRIBE `users`
881 4DESCRIBE `accounts`
661 5DESCRIBE `characters`
881 6DESCRIBE `periods`
551 7DESCRIBE `event_transactions`
662 8DESCRIBE `inventory_types`
16161 9SELECT `InventoryType`.`id`, `InventoryType`.`typeName` FROM
`inventory_types` AS `InventoryType` WHERE 1 = 1
1909119091175 10START TRANSACTION
0
0
Help? (i'm sure I've used saveall before without this problem....)
--
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