Use `onBeforeSaveEntry` event to update EntryModel properties? With my plugin I listen for onBeforeSaveEntry events and make changes to the $entry EntryModel. It works and I can change most properties from this function, but I have problems updating sectionId, typeId, authorId, postDate and expiryDate.

I looked up the relevant code in EntriesService.php and noticed that it might have something to do with a variable $entryRecord that gets saved to the DB separately (comment in the code: "Save the actual entry row").

Am I doing something wrong or is it simply not possible to set these properties from this function. As an alternative solution I could trigger a seperate saveEntry() from here, but this looks to be not the cleanest solution.

craft()-&gt;on('entries.onBeforeSaveEntry', function(Event $event)
{
    // Disable the entry
    $event-&gt;params['entry']-&gt;enabled = false;

    // Change the `authorId` (does NOT work!)
    $event-&gt;params['entry']-&gt;authorId = 1;
});
Just looking through the source file, it looks like sectionId, typeId, authorId, postDate and expiryDate are all set as properties on the $entryRecord before the onBeforeSaveUser event is fired. It also looks like $entryRecord is not accessible from the event, nor is it saved yet such that you could modify it directly. I suspect that you will need to modify these properties after the entry is saved (using the onSaveEntry event), and then resave the entry. You will also of course need to add conditionals (i.e. compare current authorId to target authorId) and only save the entry if needed, to ensure that you don't create an endless loop.