Search

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.

Using the EntryPreCreatedelegate, 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.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details