Change Log
Subscribe to the updates feed!
For more information on upgrading to the latest release, please see Upgrade Instructions
Version 1.7.1
Release Date: March 22, 2010
- 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
- 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
- French, provided by jpi
- Spanish, provided by tdktank59 and Muser
- Catalan, provided by Muser
- Brazilian Portuguese, provided by Dantetekanem
- 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 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 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.