EntryPreCreate
This is an open discussion with 4 replies, filed under Extensions.
Search
Using the EntryPreCreate
delegate, you can do:
public function myFunction($context){ $entry_id = $context['entry']->get('id'); ... }
Thanks Michael,
Can this be accessed from inside a field extension?
I have a field which relies on giving it's own ID to influence another function, but I'm not 100% sure what is possible from within an Extension that extends the field class here..
My function works fine on editing and entry.. it's just retrieving the ID on first save/commit of new entry. Would the above work in this scenario?
This is possible. Take a look at Rowan's Reflection Field. There is a compile function that has the entry object. This function is hooked into a delegate in the extension driver. So basically, the field's compile function is triggered by the delegate.
Sorry, but I am offline now for the rest of the day. Good luck! :-)
That's a good enough lead for me to investigate, thank you Michael :p
Create an account or sign in to comment.
Can someone confirm if 'EntryPreCreate' and 'EntryPostCreate' delegates are fired after 'ProcessRawFieldData'?
Just trying to think of a way to retrieve the newly created Entry ID for insertion into another table in the DB.