Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various bugfixes in preparation for 1.1 #130

Merged
merged 12 commits into from
Sep 6, 2016
Merged

Conversation

romaninsh
Copy link
Member

@romaninsh romaninsh commented Aug 29, 2016

Wouldn't that be great if there was a simple method that would convert the $data from the business realm in the way how Model prepares them for update() / insert() operations into an actual array that can be passed into DSQL ?

Now that's possible with. typecastSaveToPersistence does exactly that. Not only it converts the types for all the fields, but it also makes use of 'actual' property in SQL fields.

Documentation is important

I have added a full documentation for Field and Field_SQL classes.

Tests are added

Trying to change read_only field causes Exception. Trying to save with Mandatory field equal to NULL also causes Exception. Trying to set field with enum property to an incorrect value similarly generates an Exception.

Other Fixes

Fixed date and time fields that will no longer adjust themselves for TIMEZONE changes. The datetime is still stored in UTC.

Joined fields

Sending joined fields into their respective table also typecasts them.

@romaninsh romaninsh mentioned this pull request Aug 29, 2016
3 tasks
@@ -325,7 +325,7 @@ public function initQueryConditions($m, $q)
*
* @return array
*/
public function typecastLoadToPHP($m, $row)
public function typecastLoadFromPersistence($m, $row)
Copy link
Member

@DarkSide666 DarkSide666 Sep 5, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so, you like my variant of method name better? earlier you said that ...ToPHP is better :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants