Model Object
Model Object
addError()— Adds an error on a specific property.addErrorToBase()— Adds an error on a specific property.allChanges()— Returns a struct detailing all changes that have been made on the object but not yet saved to the database.allErrors()— Returns an array of all the errors on the object.changedFrom()— Returns the previous value of a property that has changed.changedProperties()— Returns a list of the object properties that have been changed but not yet saved to the database.clearChangeInformation()— Clears all internal knowledge of the current state of the object.clearErrors()— Clears out all errors set on the object or only the ones set for a specific property or name.compareTo()— Pass in another model object to see if the two objects are the same.delete()— Deletes the object, which means the row is deleted from the database (unless prevented by abeforeDeletecaerrorCount()— Returns the number of errors this object has associated with it.errorsOn()— Returns an array of all errors associated with the supplied property (and error name if passed in).errorsOnBase()— Returns an array of all errors associated with the object as a whole (not related to any specific property).hasChanged()— Returnstrueif the specified property (or any if none was passed in) has been changed but not yet saved tohasErrors()— Returnstrueif the object has any errors.hasProperty()— Returnstrueif the specified property name exists on the model.isNew()— Returnstrueif this object hasn’t been saved yet (in other words, no matching record exists in the databasisPersisted()— Returnstrueif this object has been persisted to the database or was loaded from the database via a finderkey()— Returns the value of the primary key for the object.properties()— Returns a structure of all the properties with their names as keys and the values of the property as values.propertyIsBlank()— Returnstrueif the specified property doesn’t exist on the model or is an empty string.propertyIsPresent()— Returnstrueif the specified property exists on the model and is not a blank string.reload()— Reloads the property values of this object from the database.setProperties()— Allows you to set all the properties of an object at once by passing in a structure with keys matching the property nametoggle()— Assigns to the property specified the opposite of the property’s current boolean value.update()— Updates the object with the suppliedpropertiesand saves it to the database.updateProperty()— Updates a singlepropertyand saves the record without going through the normal validation procedure.valid()— Runs the validation on the object and returnstrueif it passes it.