1.4.x Change Log
For more information on upgrading to the latest release, please see Upgrade Instructions
Version 1.4.3
Release Date: August 9, 2009
-
Bug Fixes
- Fixed long-standing bug where the example method for validating a login would fail.
This change could adversely affect certain logins. Please see this note here. The 1.5.0 update includes a new trim rule that should fix this problem.
- Fixed long-standing bug where the example method for validating a login would fail.
Version 1.4.2
Release Date: August 7, 2009
-
Changes
- Added code to allow looping over the object directly, so you don't have to loop over the all array. This should prevent errors when one forgets to type all. I wouldn't depend on this for now, in case it needs to be removed, but I thought I'd try it out.
-
Bug Fixes
- Fixed a typo-bug that prevented model-only extensions from being loaded (thanks to pdswan (CI forum member 53883) for finding this!).
Version 1.4.1
Release Date: August 3, 2009
-
Bug Fixes
- Fixed fairly serious bug that prevented multiple extensions from being loaded at the same time (thanks Daniel H for finding this!).
- Fixed minor bug in the example code.
Version 1.4.0
Release Date: July 27, 2009
Please look over these updates carefully, as there are a lot of new features.
-
Core Changes
- Added code to allow DataMapper models to be loaded when the object is created. To use this, you'll need to update or remove the constructors in your models.
- Added a save_as_new method to enable saving objects with existing ids.
- Added a skip_validation method to enable a save without validating.
- You can now query deep relationships, as deep as you need. See Get (Advanced) for examples.
- You can now include columns from deep $has_one relationships. See Get (Advanced) for examples.
- Added (or_)(not_)ilike methods to allow case-insensitive like queries (uses sql's UPPER() and PHP's strtoupper).
- Added query grouping through (or_)(not_)group_start and group_end methods. This enables more advanced queries.
- Added the ability to specify a default order by clause. This will allow objects to always be sorted (unless overridden).
- Created a brand-new, mostly functional example application! Feel free to install it and try it out. Alternatively, just browse the code!
-
Extension Changes
- Added the
arrayextension class. More Information. - Added the
csvextension class. More Information. - Added the
htmlformextension class. More Information. - Added the
simplecacheextension class. More Information. - Added a all_to_json method to the
jsonextension class. More Information. - Added the ability to dynamically load an extension as needed, through load_extension. More Information.
- Extensions can now receive support load-time options.
- Added the
-
Improvements
- Smarter Saving: If an object is stored on an In-Table Foreign Key, it can now be saved in the same UPDATE query as the rest of the object, removing one query for every in-table foreign key.
- Plural Related Objects: Related object lookups now allow the plural form almost everywhere. For example, $user->bug->get() and $user->bugs->get() will both look up bugs related to $user. This feature can even be used with $user->where_related_
bugs() queries. If automatic conversion to singular fails, just fall back to always calling the singular form. - Query Freeing: If you have a query that returns more than 100 items, it is now freed immediately. This may reduce memory consumption. The threshold is adjustable, simply overwrite $object->free_result_threshold. 0 means free every time.
- Datamapper ORM now only loads CodeIgniter's form_validation libary when it is first accessed. (Recommended by jpi.)
- Added a new Template model (under application/models/_template.php) to help in creating your own models.
- Various minor performance enhancements.
-
Bug Fixes
- Fixed two minor bugs in the way the built-in related validation rules were being counted, one of which was suggested by MeanStudios.
- Fixed bug where count could return incorrect values when used on an in-table foreign key relationship stored on the parent table.
- Fixed minor bug when calling this specific form of _related_model: {where}_related_
{$model}($object). For example:where_related_editor($user). - Empty labels or validation rules no longer throw an error. Also, the id field will now automatically have a validation label and rule configured, if it is not provided.
- When querying a related object [e.g.: $user->post->get() ], all user-provided where statements are automatically grouped. This prevents unexpected results when ORing statements.
-
Other Changes
- Updated the way related validation rules work, to ensure that the
related fieldwas being passed into the rules. Previously, the first argument would have been whatever was passed in to save. Now, if the $object was saved with a specificrelated_field, the $object will be wrapped in a single-item array, with therelated fieldas its key.
- Updated the way related validation rules work, to ensure that the
- Added a method _count_related_objects to more accurately count related objects passed into save.
- Added methods _save_itfk and _save_related_recursive to assist in smarter saving.
- The _like methods no longer rely on CodeIgniter's code. This was required to allow query grouping to work.
- Added a _boolean rule to aid in forcing values as TRUE or FALSE. See Validation.
- Updated the extensions documentation to break out each extension into its own page.
- Added a Glossary to define some Datamapper ORM-specific terms.
- Converted all LEFT JOINs into LEFT OUTER JOINs, to make Datamapper ORM more “correct”. Please leave a comment on the forums if this causes any issues.
- Moved older changelogs onto their own pages (see below).
- Color coded all example PHP code, making examples (hopefully) easier to read.