I have a plugin using the onBeforeSaveEntry event. Is there a simple way to check if the entry being saved is a brand new entry i.e. Add New Entry or if it currently exists and is just being updated?
1 Answer
You should be able to check for this like so:
if($params['isNewEntry'])
{
// The entry is new
{
else
{
// The entry is being updated
{
See here in the docs: http://buildwithcraft.com/docs/plugins/events-reference#entries-onBeforeSaveEntry