3070 Posts in 869 Topics by 651 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1379 Views |
-
ID of an entry in the DB before write()?

22 February 2009 at 10:54am Last edited: 22 February 2009 10:54am
Aaand, me again
This time I want to store a reference to the entry that I'm going to write.
For testing I whipped up some code that tries to store the ID of the entry simply in an extra field, something like this:function saveCalEntry($data, $form) {
$entry = new simpleCalEntry();
$form->saveInto($entry);
$IDofthisdata = $entry->ID; // How do I get the ID of this new entry?
$entry->recurring = $IDofthisdata;
$entry->write();
}But unfortunately it seems that ID isn't set before write(). Any ideas on how I could go for it?
Thanks in advance /Carsten
-
Re: ID of an entry in the DB before write()?

22 February 2009 at 12:13pm
Answering myself again, got the hint from ajshort:
No, you can't easily get the ID of an entry before write() but you can get it immediately afterwards then fiddle what you want and call write() again.
Easy, huh? ;)
/Carsten
| 1379 Views | ||
|
Page:
1
|
Go to Top |

