-
Notifications
You must be signed in to change notification settings - Fork 2
2.0 — Feature: Built-in system for converting from query data #19
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
Open
JasonTheAdams
wants to merge
31
commits into
release/2.0.0
Choose a base branch
from
feature/from-query-data
base: release/2.0.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
0bfba41
refactor: switches to static what can be
JasonTheAdams 3bed92a
test: updates tests to use static properties/methods
JasonTheAdams 4c05c26
refactor: switch more to static
JasonTheAdams 24ba49b
test: updates remaining tests
JasonTheAdams b8e8831
feat: adds native model buildings from query data
JasonTheAdams 6541267
chore: adds additional docs
JasonTheAdams 2c2a2d4
chore: updates docs
JasonTheAdams 0dcc15b
chore: updates outdated flows
JasonTheAdams dc52d77
Merge branch 'main' into refactor/static-methods-properties
JasonTheAdams 7ff61d8
test: updates properties in tests
JasonTheAdams 3bdedb7
chore: fixes syntax in readme
JasonTheAdams 90b7a08
Merge branch 'refactor/static-methods-properties' into feature/from-q…
JasonTheAdams 235d54e
fix: fetches relationship statically
JasonTheAdams cff40fb
Merge branch 'refactor/static-methods-properties' into feature/from-q…
JasonTheAdams 99769e0
refactor: cleans up ModelQueryBuilder
JasonTheAdams 254b408
fix: corrects static syntax
JasonTheAdams a7c7c3b
Merge branch 'refactor/static-methods-properties' into feature/from-q…
JasonTheAdams 676dff6
feat: improves data casting
JasonTheAdams 8a3bc18
refactor: corrects spacing
JasonTheAdams cf435ab
Merge branch 'release/2.0.0' into feature/from-query-data
JasonTheAdams 8ec57b7
refactor: changes to fromData
JasonTheAdams dafd8ef
feat: skips casting if value is correct type
JasonTheAdams 90a6def
fix: corrects changed interface
JasonTheAdams f433793
test: tries fixing syntax error
JasonTheAdams b99d67f
refactor: removes sttaic return type as it is not 7.4 compat
JasonTheAdams 29359f3
chore: bumps min PHP version to 7.4
JasonTheAdams b838c79
test: adds fromData model test
JasonTheAdams 77f50f2
test: adds fromModel exception test
JasonTheAdams 8dd2f82
test: ignores extra data
JasonTheAdams 7be8ba8
test: ignore missing
JasonTheAdams 64bf370
test: marks tests as skipped for now
JasonTheAdams File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
namespace StellarWP\Models\Contracts; | ||
|
||
use StellarWP\Models\ModelQueryBuilder; | ||
|
||
/** | ||
* @since 2.0.0 | ||
*/ | ||
interface ModelBuildsFromData { | ||
/** | ||
* @since 2.0.0 | ||
* | ||
* @param array|object $data | ||
* | ||
* @return Model | ||
*/ | ||
public static function fromData( $data ); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
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.
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.
I feel like this could happen up the chain before we get into casting, doing something like
$this->isPropertyTypeValid($key, $value)
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.
I purposely want to do this here so all someone has to do is overload this function to support additional casting of types.