Change Log
Subscribe to the updates feed!
For more information on upgrading to the latest release, please see Upgrade Instructions
Version 1.8.2.1
Release Date: December 30th, 2011
- New Features
- Datamapper index.php bootloader now supports multiple database instances.
- Bug Fixes
- Added a default timestamp format to the config file to be compliant with MySQL's DATETIME format.
- Fixed broken configuration overrides through model properties.
- Fixed loading extensions with a fully qualified extensions path from the config file.
- Other Changes
- [Htmlform] Only process options if an options array was actually passed.
Version 1.8.2
Release Date: November 30th, 2011
- New Features
- Backported the DataMapper 2.0 bootstrap to get access to core classes in CodeIgniter version 2.0.3 and above.
- Changed the way watched methods are processed. This allows extensions to replace core methods.
- Add support for an absolute path for "extensions_path".
- Added a all_to_single_array() method to the array extension.
- Bug Fixes
- Added a default for nestedsets root field name as described in the documentation.
- Fixed ignoring model configuration properties with a NULL or FALSE value.
- Fixed broken trans_status() method.
- Other Changes
- Improved the way the available model paths are determined.
- Several corrections to the documentation.
Version 1.8.1
Release Date: June 7th, 2011
- New Features
- Alternative model locations are supported through the model_path advanced relationship parameter, or through the add_model_path static method.
- Added new truncate method to delete all records, and relations to those records.
- You can now pass a string as parameter to the to_array() and all_to_array() methods of the array extension, if you want to select only a single field.
- You can now run include_related on 'many' relations, see runtime for an explaination.
- Added new force_validation() method to force revalidation when you read a record from the database that would not pass the save rules.
- A new configuration value cascade_delete determines if delete operations need to cascade. See here.
- Added support for the new CI reactor versions, in which Lang and Loader library properties are no longer public.
- Added new where_between() methods to support "WHERE field BETWEEN a AND b" type queries.
- The json extension now supports related objects, which will be exported as nested objects ('id' fields only).
- Bug Fixes
- Added support for a database prefix when specifying a join table ('database.tablename').
- Extensions now receive the object that loads then as second parameter of the constructor, as documented.
- Do not unnecessarily join tables in a many to many relationship when defining a where clause on the related 'id' field.
- Fixed broken subqueries.
- Fixed broken like() queries: missing trailing space and no automatic escaping.
- Fixed nestedsets extension methods for moving sibling and child objects.
- Fixed language error messages in the log due to undefined validation labels when using CI Reactor or CI 2.0.2.
- Fixed incorrect SQL generated when using where() with a multi-value array just after a group_start().
- Fixed broken query caching when using group_start().
- Other Changes
- Datamapper now checks if the CodeIgniter database library is loaded when the Datamapper class is instantiated, and exits with an error message if not.
- The functionality of reciprocal self relationships is more clearly documented.
Version 1.8.0
Release Date: January 12, 2011
- New Features
- Added a new extension which allows you to use Datamapper for nested set tree management.
- Added dutch language file.
- Added a new extension which allows you to use Datamapper for nested set tree management.
- It is now possible to define model relations, and update the model production cache, at runtime.
- Updated the select() method to accept an array of column names next to a comma delimited string, like CodeIgniters Activerecord does.
- The updated column can now be modified manually. The save method will save the update even if the updated timestamp is the only modified field.
- The column name is now used as key of the error->all array, which allows you to reference the column name when iterating over the errors.
- Added (experimental) support for reciprocal many-to-many relationships. See Advanced Relationships.
- Added the option to define the name of the relationship table in an advanced relationship definition.
- Added the option to run $object->{query}_related using a Datamapper object as $value. In case the object contains multiple values, the query will be transformed to a 'where_in' query using the id's in the objects resultset.
- >Added the option to run $object->{query}_related using an array of id's. If the array contains multiple values, the query will be transformed to a 'where_in' query using the id's in the objects resultset.
- Bug Fixes
- Fixed problem with get_iterated when using PHP 5.3+ which doesn't do an implicit type conversion from array to object, causing an isset() to fail.
- Fixed PHP fatal error when loading a model when using CI 2.0 packages or Modular CI, and a package or module is missing a models directory.
- Fixed incorrect SQL count and SQL error on get_paged and get_paged_iterated when paging through a related table, linked to the parent using a relationship table, and including a where clause on a parent column.
- Fixed race condition that could case a fatal error due to recursion when deleting ITFK's.
- Other Changes
- All language files have been converted to UTF-8.
- Replaced hardcoded check for the MY_ prefix with the 'subclass_prefix' config value when autoloading classes.
- When using include_join_fields, the id field of the relationship table is included as well.
- Added some info about the post_model_init method to the documentation.
- The manual now makes it clear that there are several reasons for a save to fail and gives some examples of what to check.
Version 1.7.1
Release Date: March 22, 2010-2011
- New Features
- New function, is_related_to, which can be used to see if two objects are related.
- Bug Fixes
- Datamapper ORM models can now be loaded via $CI->load->model() (and autoloaded) again—even though you really shouldn't, so a warning will be logged when in debug mode.
- While EE and CI 2.0 aren't officially supported, Jack Scott, has provided some code that allows Datamapper ORM to load models from any model directory, not just application/models.
- Fixed bug in the automatic conversion of the id field to an integer.
- Fixed bug where get_iterated could have problems when running queries (such as delete) over the set.
- All of the extensions (even HTMLForm) have been updated to take advantage of get_iterated and result_count.
- Other Changes
- The minumum PHP version required has been bumped up to 5.1.2, since autoloading of resources isn't available on older version.
- A new method, _dmz_assign_libraries has been added, and is the actual _assign_libraries function. The original method just logs a warning, and is never used by Datamapper ORM.
- Added a section to get_iterated that helps determine when to use get_iterated over plain get.
- The example application has been updated to take advantage of get_iterated and result_count.
- The examples in the manual have been updated to remove looping over ->all directly, as it is recommended to use the iterator now.
- Corrected typos that referred to $db_params as $dbparams, and also that referred to the default value as TRUE, as opposed to ''.
- Fixed $db_params so that TRUE is an acceptable value, and is the same as ''.
- Completely rewrote delete_all. It now returns FALSE if any of the deletes fail (and TRUE in all other cases), and works with get_iterated.
Version 1.7.0
Release Date: March 15, 2010-2011
- Performance Improvements
This release if Datamapper ORM has had a substantial focus on performance. None of these changes should affect your existing code, but you may see a 40-50% speed improvement across the board, especially when using the new get_iterated method. Even smaller queries will probably see a noticeable difference in both speed and memory usage.
-
Many subtle performance improvements were suggested by TheJim. I have also scoured the code base for other small enhancements.
- When checking the id field of related models, Datamapper ORM will now work with the [model]_id column of the join table or the in-table foreign key directly whenever possible. This removes one join from many queries.
-
The way databases are created, connected to, and closed has been significantly improved:
- Normal, shared databases (ie, $db_params is '') will only be connected to once.
- Also in the default situation, the db object is now cloned, instead of creating a new one each time.
- All databases are now properly closed, even if the page exits in an error. While this doesn't affect the majority of situations, it does ensure that pooling daemons know when to return a connection to the pool.
-
- New Features
- Automatic localization can be enabled for field and relationship labels, and Datamapper ORM methods can even be used to access model-specific localized text in a consistent manner.
- New method, get_iterated, for streaming the results of a query, so that only one object exists in memory per row.
- New methods, get_paged and get_paged_iterated, to easily handle paged queries. A single method provides the page of results, a well as number of pages, total number of rows, and more.
- New method, count_distinct, which counts the number of DISTINCT rows in a query.
- New method, get_raw, for getting the raw results of any Datamapper ORM query. (I.E.: without converting rows into objects.)
- Alternate form for the {query}_func method, {query}_field_func, that allows you to compare an object's field to the result of a function.
- Added a new method, result_count, which returns the number of items from the last query. This can be used to make switching between get and get_iterated easier. See Counting.
- Functions can now have a string inserted directly, without any escaping at all, by wrapping the string in square brackets: [ ].
- There is a new method, reinitialize_model, that can be used to forcibly re-load a model's configuration (for example, language settings).
- Extensions
- A new extension,
rowindex, has been added for finding the row of a given object or set of objects for an already-built query. - The HTML Form extension is no longer supported. Please see the note on that page for more information.
- A new extension,
- Bug Fixes
- Fixed a bug where get_sql was not clearing part of the previous query.
- Changed the exists method to properly handle the unusual case of querying for an object but not including the id field.
-
Changed the way select_func and select_subquery are added to the SELECT array, to prevent AR from splitting them by comma.
However, I was unable to completely prevent AR from breaking some queries. Please see here for a possible fix. - All table aliases have had the keyword AS removed from the query. (Fixed support with Oracle.)
- Fixed a bug when using include_related while $db_params was FALSE.
- Custom error messages that are returned from custom validation rules was not working. It now should work fine.
- The update function now automatically sets the updated timestamp if it exists on the table. (Thanks goes to Nicolas Pétillon.)
- Other Changes
- Modified get_clone to better handle the db object. You can now clone a partial query simply using get_clone before calling get. This can then be used to process two similar but slightly different queries. (If $db_params is set to FALSE, please read Database Object Cloning.)
- get_sql can now correctly process the parent relationship. By default this is disabled.
- It is now possible to override the default format for updated and created timestamps, with the new timestamp_format property.
-
For error, replaced the generic
stdClassobject with a custom one. This object will never error when accessing an unset message (although isset() still works), and also provides code completion hints. (Thanks NachoF for finding the bug that led to this one.) - All Datamapper ORM properties and methods are now properly marked as public, protected, or private. The inline PHPDocs have been cleaned up and made consistent for all methods and properties. Some previously public members have been renamed or made private, so you may have issues with complex extensions.
- If you use an IDE that supports PHP code completion via PHPDoc-formatted tags, many (many) magic properties and magic methods have been defined. (An example IDE is Netbeans 6.8 or ZendStudio.)
- The inflector_helper has been updated with a few more rules to be even more accurate in pluralizing English words.
- Due to the new localizable field labels, the computed label value is no longer stored when using the production cache. (If it was, it could not be localized.) The performance penalty of setting up the label once per model is minor.
- Manual Changes
- Several items have been moved around in the manual to eliminate some of the smaller pages. You will find documentation on exists and clear now under Utility Methods. Also, get_sql has been moved to the new Get (Alternatives) section.
- New page for Localization.
- New page for Get Alternatives.
- New page for the Row Index extension.
Version 1.6.2
Release Date: December 28, 2009
- Bug Fixes
- Related deletes were not returning the success or failure of the delete. (TheJim)
- Fixed unusual bug in recursively saving In-Table Foreign Keys. (TheJim)
- Fixed bug when instantiating included related items where the id of the related item was set incorrectly. (TheJim)
- Subqueries were incorrectly replacing advanced relationship related tables (as in include_related_count). (Cro_Crx.)
- New Languages
- Other Changes
- Updated the Count page in the manual to provide information on $object->count() vs count($object->all).
- Updated Troubleshooting to provide more information about solving common problems.
- Cleaned up the downloads page in the manual to hide outdated version by default.
- The downloadable manual no longer include the older change logs. These instead point to the version on the website.
Version 1.6.1
Release Date: November 30, 2009
- Changes
-
Fixed bug found by monkeyhouse (CI forum member 68134) in the db_params default configuration.
You only need to get this update if you are getting a “You have not selected a database type to connect to.” error.
-
Fixed bug found by monkeyhouse (CI forum member 68134) in the db_params default configuration.
Version 1.6.0
Release Date: November 23, 2009
- Core Changes
-
The database class is now instantiated as needed, and models no longer share database instances. The purpose of this change is to allow for subqueries, and allow more than one query to be built at a time.
This change could break classes that expect a shared $this->db.
The change is explained a little more here, and the new configuration option is here.
- You can easily include the number of related items in a query, using include_related_count. Usage and example.
-
-
New Features
- Subqueries: DataMapper models can now be used to build subqueries using AR methods. Subqueries page.
- SQL Functions: DataMapper models can also easily incorporate SQL functions and formulas into queries, while escaping strings and referencing fields and related fields. Functions page.
-
Other Changes
- The results from an include_related can now be automatically instantiated directly into Datamapper ORM models.
- The text SQL can be built and returned without running a query, via get_sql().
- A new validation rule, 'always_validate', forces validation of empty fields even if for empty fields. Some rules may throw an error, or have unexpected consequences when using this rule.
- Various minor changes throughout the docs.
-
Bug Fixes
- If a join field was used in a LIKE test, it was calling the original Active Record method. This has been fixed.
Older changelogs:
- Version 1.5.x
- Version 1.4.x
- Version 1.3.x
- Version 1.2.x
- Version 1.0 - 1.2.3 are lost to time :)
First publicly released version.