i would do that with a set of different actions. To see if an object is new you can call object->_isNew(), the underscore tells you it is a internal method, so it might be better to use getUid() === NULL