Skip to content

Add Model::loadBy() complex condition support#1125

Merged
mvorisek merged 28 commits intodevelopfrom
load_by_arr
Sep 3, 2023
Merged

Add Model::loadBy() complex condition support#1125
mvorisek merged 28 commits intodevelopfrom
load_by_arr

Conversation

@mvorisek
Copy link
Copy Markdown
Member

@mvorisek mvorisek commented Aug 31, 2023

also introduce Model::createIteratorBy() method

both methods accept exactly the same data as Model::addCondition() method

@mvorisek mvorisek added the MAJOR label Sep 1, 2023
@mvorisek mvorisek force-pushed the load_by_arr branch 2 times, most recently from 9ca2cae to 7b9b1bc Compare September 2, 2023 01:45
@mvorisek mvorisek marked this pull request as ready for review September 2, 2023 11:30
@PhilippGrashoff
Copy link
Copy Markdown
Contributor

Hi @mvorisek,

I wonder what the usecase of this is? At the moment, loading with complex conditions can be done by something like

$someModel->addCondition(...);
$someModel->addCondition(...);
$someModel->addCondition(...);
$someModel->addCondition(...);
$someModel->addCondition(...);
$someModel->loadAny(); //or loadOne()

What is the advantage of providing loadBy() with much more complex arguments?

Best regards
Philipp

@mvorisek
Copy link
Copy Markdown
Member Author

mvorisek commented Sep 2, 2023

What is the advantage of providing loadBy() with much more complex arguments?

@PhilippGrashoff the model (and result entity) conditions are not mutated, the "load by" conditions are used to restrict the condition during the lookup only

@mvorisek mvorisek force-pushed the load_by_arr branch 3 times, most recently from 722c4d7 to b675dba Compare September 2, 2023 15:00
@mvorisek mvorisek changed the title Add support for complex condition in Model::loadBy() Add Model::loadBy() complex condition support Sep 2, 2023
@mvorisek mvorisek force-pushed the load_by_arr branch 2 times, most recently from 773df62 to 03712f0 Compare September 2, 2023 23:28
@mvorisek mvorisek merged commit d5d5f82 into develop Sep 3, 2023
@mvorisek mvorisek deleted the load_by_arr branch September 3, 2023 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

2 participants