Skip to content

Model Configuration

Model Configuration

  • accessibleProperties() — Use this method to specify which properties can be set through mass assignment.
  • afterCreate() — Registers method(s) that should be called after a new object is created.
  • afterDelete() — Registers method(s) that should be called after an object is deleted.
  • afterFind() — Registers method(s) that should be called after an existing object has been initialized (which is usually done with the
  • afterInitialization() — Registers method(s) that should be called after an object has been initialized.
  • afterNew() — Registers method(s) that should be called after a new object has been initialized (which is usually done with the
  • afterSave() — Registers method(s) that should be called after an object is saved.
  • afterUpdate() — Registers method(s) that should be called after an existing object is updated.
  • afterValidation() — Registers method(s) that should be called after an object is validated.
  • afterValidationOnCreate() — Registers method(s) that should be called after a new object is validated.
  • afterValidationOnUpdate() — Registers method(s) that should be called after an existing object is validated.
  • automaticValidations() — Whether or not to enable default validations for this model.
  • beforeCreate() — Registers method(s) that should be called before a new object is created.
  • beforeDelete() — Registers method(s) that should be called before an object is deleted.
  • beforeSave() — Registers method(s) that should be called before an object is saved.
  • beforeUpdate() — Registers method(s) that should be called before an existing object is updated.
  • beforeValidation() — Registers method(s) that should be called before an object is validated.
  • beforeValidationOnCreate() — Registers method(s) that should be called before a new object is validated.
  • beforeValidationOnUpdate() — Registers method(s) that should be called before an existing object is validated.
  • belongsTo() — Sets up a belongsTo association between this model and the specified one.
  • dataSource() — Use this method to override the data source connection information for this model.
  • hasMany() — Sets up a hasMany association between this model and the specified one.
  • hasOne() — Sets up a hasOne association between this model and the specified one.
  • nestedProperties() — Allows for nested objects, structs, and arrays to be set from params and other generated data.
  • property() — Use this method to map an object property to either a table column with a different name than the property or to a SQL e
  • protectedProperties() — Use this method to specify which properties cannot be set through mass assignment.
  • setPrimaryKey() — Allows you to pass in the name(s) of the property(s) that should be used as the primary key(s).
  • setPrimaryKeys() — Alias for setPrimaryKey().
  • setTableNamePrefix() — Sets a prefix to prepend to the table name when this model runs SQL queries.
  • table() — Use this method to tell CFWheels what database table to connect to for this model.
  • validate() — Registers method(s) that should be called to validate objects before they are saved.
  • validateOnCreate() — Registers method(s) that should be called to validate new objects before they are inserted.
  • validateOnUpdate() — Registers method(s) that should be called to validate existing objects before they are updated.
  • validatesConfirmationOf() — Validates that the value of the specified property also has an identical confirmation value.
  • validatesExclusionOf() — Validates that the value of the specified property does not exist in the supplied list.
  • validatesFormatOf() — Validates that the value of the specified property is formatted correctly by matching it against a regular expression us
  • validatesInclusionOf() — Validates that the value of the specified property exists in the supplied list.
  • validatesLengthOf() — Validates that the value of the specified property matches the length requirements supplied.
  • validatesNumericalityOf() — Validates that the value of the specified property is numeric.
  • validatesPresenceOf() — Validates that the specified property exists and that its value is not blank.
  • validatesUniquenessOf() — Validates that the value of the specified property is unique in the database table.