DataMapper


Configuration

DataMapper has some configuration settings which you can customise to suit your needs. They will apply to all DataMapper models unless overridden in the models themselves. These are:

Name Type Description Default
prefix String If set, will require all tables (both normal and joining tables) to have this prefix.
join_prefix String If set, will require all joining tables to have this prefix (overrides prefix).
error_prefix String If set, will be prepended onto each error message. <p>
error_suffix String If set, will be appended onto each error message. </p>
created_field String The field name for storing the created timestamp. created
updated_field String The field name for storing the updated timestamp. updated
local_time Boolean If set to TRUE, will use local timestamps. Otherwise, GMT/UTC is used. FALSE
unix_timestamp Boolean If set to TRUE, will use 'Unix Timestamp' instead of 'DateTime'. FALSE
auto_transaction Boolean If set to TRUE, will automatically handle transactions. FALSE
auto_populate_has_many Boolean If set to TRUE, will automatically populate related "has many" objects on first access. FALSE
auto_populate_has_one Boolean If set to TRUE, will automatically populate related "has one" objects on first access. FALSE

To modify your settings, open the application/config/datamapper.php file with a text editor and set your preferred configuration settings.

Note:  You can override these settings by specifying values directly in your models.