Change Log
Version 1.6.0
Release Date: December 10, 2008
-
Core Changes
- Added a query() method.
- Renamed private _related() method to _get_relation(), then added a different private _related() method.
-
Added related query methods for more advanced queries via the _related() method. These are:
- where_related()
- or_where_related()
- where_in_related()
- or_where_in_related()
- where_not_in_related()
- or_where_not_in_related()
- like_related()
- not_like_related()
- or_like_related()
- or_not_like_related()
- having_related()
- or_having_related()
-
Improvements
- Replaced array_push() with ${array}[] to remove the overhead of calling a function.
-
Other Changes
- Added a Query page to the user guide.
- Added a Get (Advanced) section to the Get page of the user guide.
- Added a Get By (Advanced) section to the Get By page of the user guide.
- Updated a number of pages in the user guide to reflect the latest version.
-
Bug Fixes
- Fixed so CodeIgniter Form Validation library is only loaded if not already loaded.
Version 1.5.4
Release Date: December 6, 2008
-
Bug Fixes
- Fixed the refreshing of stored values so save() functions correctly.
- Fixed created and updated field checks to use in_array() instead of array_key_exists().
-
Improvements
- Moved check to see if only the updated field changed to outside the foreach.
- Changed to load the Form Validation library for easier reuse.
Version 1.5.3
Release Date: December 5, 2008
-
Bug Fixes
- Fixed $parent for self referencing objects.
- Changed $fields from an associative array back into a normal array containing only field names.
Version 1.5.2
Release Date: December 4, 2008
-
Bug Fixes
- Fixed config file settings to be correctly assigned by reference.
- Fixed common model settings to be correctly assigned by reference.
- Changed count() to internally use the slightly faster count_all_results() method.
- Changed _related() to specify the relationship tables on the join by id's.
Version 1.5.1
Release Date: December 4, 2008
-
Bug Fixes
- Reverted $parent from an object reference back into an array to fix memory issue.
- Fixed constructor to not override model specific settings with config file settings.
- Fixed _to_object() to populate the $stored variable.
Version 1.5.0
Release Date: December 3, 2008
-
Core Changes
- CodeIgniter 1.7.0 is now required due to the new Form Validation library.
- Improved save() method to allow saving of object data and relationship data at the same time.
- Changed the all property to allow access by id ($object->all[$id]).
- Replaced the auto_populate_related setting with auto_populate_has_many and auto_populate_has_one settings.
- Replaced the $related variable with a $parent variable that is a reference to the parent object.
- Removed the private _changed(), _changed_existing() and _changed_non_existing() methods.
-
Added new main methods, including a dynamic get_by_{field}() method. These are:
- get_by_{field}()
- get_clone()
- get_copy()
- clear()
- count()
- exists()
-
Improvements
- Many improvements are due to the very useful contributions by commandercool and OverZealous.com.
- General overhaul and fine tuning to improve performance.
- Removed all unnecessary code, such as properties that are never accessed, unneeded strtolower() calls, etc.
- Reworked testing of changed values when validating to remove the need for any database calls.
- Changed the constructor to use the much faster field_data() method instead of the list_fields() method.
- Added static variables for common data storage, meaning initialisation data is prepared only once per model instead of per instance.
-
Validation
- Updated validate() to use the new Form Validation library.
-
Added new validation rules. These are:
- min_date
- max_date
- min_size
- max_size
- valid_date
- valid_date_group
- Added validation for relationships. The related validation rules are:
- required
- min_size
- max_size
- Recoded the self referencing examples to better demonstrate how you need to override the get() and count() methods to get the correct behaviour. Also included an example of using relationship validation rules.
- Reviewed code so it meets the CodeIgniter PHP Style Guide.
- Added a Get By page to the user guide.
- Added a Get Clone page to the user guide.
- Added a Get Copy page to the user guide.
- Added a Clear page to the user guide.
- Added a Count page to the user guide.
- Added a Exists page to the user guide.
- Updated a number of pages in the user guide to reflect the latest version.
- Fixed the Automated Timestamp to save correctly when doing UPDATE queries.
- Fixed several very rare bugs with thanks to OverZealous.com.
Version 1.4.5
Release Date: October 15, 2008
-
Bug Fixes
- Fixed save() to update changed non-validated fields when doing UPDATE queries.
Version 1.4.4
Release Date: October 13, 2008
-
Bug Fixes
- Fixed save() to not attempt to update if there are no changed fields when doing UPDATE queries.
Version 1.4.3
Release Date: October 13, 2008
-
Improvements
- Changed save() to only insert populated fields when doing INSERT queries (NULL or empty string values will default to those in the Database).
- Changed _assign_libraries() to assign only the required libraries.
-
Bug Fixes
- Fixed validate() so fields that are not required are only validated if they contain a value.
Version 1.4.2
Release Date: October 12, 2008
-
Improvements
- Changed save() to only update changed fields when doing UPDATE queries.
- Changed autoload() so it will not attempt to autoload CI_ or MY_ prefixed classes.
Version 1.4.1
Release Date: October 11, 2008
-
Bug Fixes
- Fixed autoloading of configuration settings to be explicit.
Version 1.4.0
Release Date: October 11, 2008
-
Core Changes
- Converted DataMapper into a Library (how you use it remains the same but how you install it is different).
- Added a config file for the ability to autoload global configuration settings.
- Changed use of $has_many and $has_one to require just the model names (no longer associative arrays that require the table as well).
- Changed the way related model names and table tables are internally determined to ensure they're correct.
-
Added methods for Transactions, including the ability to automate the transaction handling. These are:
- trans_off()
- trans_strict()
- trans_start()
- trans_complete()
- trans_begin()
- trans_status()
- trans_commit()
- trans_rollback()
- _auto_trans_begin()
- _auto_trans_complete()
-
Automated Timestamps
- Added ability to set whether automated timestamps are local time or GMT/UTC.
- Added ability to set whether automated timestamps are 'DateTime' or 'Unix Timestamp'.
-
Other Changes
- Reviewed code so it meets the EllisLab Development Guidelines.
- Added a Configuration page to the user guide.
- Added a Transactions page to the user guide.
- Updated a number of pages in the user guide to reflect the latest version.
-
Bug Fixes
- Fixed save() and delete() to return TRUE if the save or delete of a relationship is successful.
- Fixed save() to use insert_id() to get the ID after an insert, rather than doing a get().
Version 1.3.4
Release Date: October 8, 2008
-
Settings
- Added ability to use table prefixes, including the ability to give joining tables a different prefix.
-
Auto-load
- Replaced __autoload() with spl_autoload_register(), moving the autoload code into the DataMapper class.
- Improved so it performs a recursive search of the models directory, if the class being auto-loaded is not found in the models directory.
-
Validation
- Added error messages to the language file for the _unique_pair() and _valid_match() pre-processing rules.
- Improved so array parameters can be used in error messages (such as with _valid_match()).
-
Other Changes
- Added a Setting up Table Prefixes page to the user guide.
- Added that there is a requirement to auto-load the Database library to the Installation Instructions page in the user guide.
- Updated a number of pages in the user guide to reflect the latest version.
Version 1.3.3
Release Date: October 3, 2008
-
Validation
- Added _unique_pair() pre-processing rule (checks if the value of a property, paired with another, is unique).
- Added _valid_match() pre-processing rule (checks whether the field value matches one of the specified array values).
-
Other Changes
- Updated a number of pages in the user guide to reflect the latest version.
-
Bug Fixes
- Fixed _prep_url(), _strip_image_tags(), _xss_clean() and _encode_php_tags() to work correctly.
Version 1.3.2
Release Date: October 2, 2008
-
Bug Fixes
- Fixed _to_array() so it returns all properties (including zero, NULL and empty strings) except when getting by objects properties ($object->validate()->get()).
- Fixed _to_object() so it returns all properties (including zero, NULL and empty strings).
- Fixed error messages using a field name as the parameter, to use the label instead (such as in the matches rule).
Version 1.3.1
Release Date: October 2, 2008
-
Examples
- Added a complete example of a DataMapper model with self referencing relationships, along with some useful code gems.
-
Other Changes
- Updated a number of pages in the user guide to reflect the latest version.
-
Bug Fixes
- Fixed so self referencing relationships are possible (try the Usage Examples to see it in action).
Version 1.3.0
Release Date: September 29, 2008
-
Related Objects
- Auto Population of related objects is now OFF by default so you can do it manually with a more defined related query (read Setting Up Relationships to see how to turn Auto Populate back on, and why it is now off by default).
- Reworked related objects so you can populate them in the same way as your normal objects, by building up your queries using the where(), like() and so on methods, before calling the get() method.
-
Validation
- Added ability to label fields for nicer error messages.
- Added ability to validate non-Database Table fields (these fields still need to pass validation if you're updating a record, read Validation for more information).
-
Other Changes
- Fixed errors in the example code of the Getting Started page in the user guide.
- Updated a number of pages in the user guide to reflect the latest version.
-
Bug Fixes
- Fixed error_message() method so it uses the $error_prefix and $error_suffix correctly.
Version 1.2.1
Release Date: September 24, 2008
-
Validation
- Added a language file for use with the error messages of DataMapper-only validation rules.
-
Bug Fixes
- Removed $this->valid check from get() method so "Getting by Object Properties" works correctly.
Version 1.2
Release Date: September 17, 2008
-
Core Changes
- Added a get() method as the main method for retrieving data.
-
Added all relevant Active Record methods for comprehensive data retrieval capabilities, complete with method chaining. These are:
- select()
- select_max()
- select_min()
- select_avg()
- select_sum()
- distinct()
- get_where()
- where()
- or_where()
- where_in()
- or_where_in()
- where_not_in()
- or_where_not_in()
- like()
- not_like()
- or_like()
- or_not_like()
- group_by()
- having()
- or_having()
- order_by()
- limit()
- offset()
- start_cache()
- stop_cache()
- flush_cache()
- DataMapper constructor no longer accepts any parameters.
-
Validation
- $error_prefix and $error_suffix variables added for formatting individual errors.
- $object->error->message added as a single string containing all errors.
- _alpha_dash_dot($field) function added.
- _alpha_slash_dot($field) function added.
- error_message($field, $error) function added.
-
Automated Timestamps
- $created_field and $updated_field variables added for naming created and updated fields for automated 'DateTime' timestamp management.
-
Other Changes
- Removed the find() method.
- Added a Get page to the user guide.
- Added a Automated Timestamps page to the user guide.
- Renamed the To Do List into the Road Map page in the user guide.
- Updated a number of pages in the user guide to reflect the latest version.
Version Beta 1.0
Release Date: September 7, 2008
First publicly released version.