-
Notifications
You must be signed in to change notification settings - Fork 46
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
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Applied fixes from StyleCI
Applied fixes from StyleCI
This was referenced Sep 5, 2016
Closed
Closed
@@ -325,7 +325,7 @@ public function initQueryConditions($m, $q) | |||
* | |||
* @return array | |||
*/ | |||
public function typecastLoadToPHP($m, $row) | |||
public function typecastLoadFromPersistence($m, $row) |
There was a problem hiding this comment.
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 withenum
property to an incorrect value similarly generates an Exception.Other Fixes
Fixed
date
andtime
fields that will no longer adjust themselves for TIMEZONE changes. Thedatetime
is still stored in UTC.Joined fields
Sending joined fields into their respective table also typecasts them.