Objects of class framework\orm\classes\deletedInstance are created and replaces the activeRecord instances when an activeRecord instance is being deleted. This is done in order to avoid having errors like "trying to access method on NULL" and provide a more meaningful error. This is achieved with overloading the properties and calls. There is also a method get_deletion_bt_info() that will provide a backtrace where the activeRecord instance was destroyed.
NOTE: The instance replacement will only work if all activeRecord instances are passed and assigned by reference.