DMZ 1.7.1 (DataMapper OverZealous Edition) |
[eluser]uptime[/eluser]
I think I've found an issue with DMZ and PHP > 5.3.0. Example code: Code: $m->include_related('some_model', NULL, TRUE, TRUE /* instantiate */); Code: var_dump( $m->some_model->exists() ); // Outputs TRUE, however, the data does not exist (NULL); After some debugging, I've found that DMZ may not instantiate the related model correctly due to a PHP bug. Bugfix/Workaround: In _to_object(), replace: Code: foreach ($this->fields as $field) With the following: Code: foreach ($this->fields as $field) It fixed my issue on PHP 5.3.2. Did anyone else have such an issue? Edit: The correct way of fixing this would probably to use the __isset() magic function on the DataMapper object to prevent the same issue from happening again. |
Welcome Guest, Not a member yet? Register Sign In |