Translation Methods (translate)
To enable these methods, add 'translate' to DataMapper's config, under 'extensions'.
Runs (a selected list of) object properties through CodeIgniters language method so you can store language keys in the database.
translate($fields)
- $fields: (Optional) If provided, only these fields will be included. If empty or not provided, only the database columns will be included.
- Returns: All properties in the $object's field list translated, if the field content is defined as a language line.
Usage
$u = new User(); $u->get_by_id($user_id); $u->translate();