Change Log
Subscribe to the updates feed!
For more information on upgrading to the latest release, please see Upgrade Instructions
Version 1.7.0
Release Date: February Soonish, 2010
- Performance Improvements
-
Many subtle performance improvements were suggested by TheJim. I have also scoured the code base for other small enhancements.
None of these changes should affect your existing code, but you may see up to a 40% improvement when working with very large queries. Smaller queries will probably not see a noticeable difference.
- When checking the id field of related models, DMZ 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.
-
- New Features
- 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 DMZ 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 braces: [ ].
- Extensions
- A new extension,
rowindex, has been added for finding the row of a given index or set of indices 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.
- 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, 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.) - 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.
- All DMZ 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.)
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 DMZ 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.