Automatically set lookupFields based on the entities identifier fields#9
Automatically set lookupFields based on the entities identifier fields#9lsmith77 wants to merge 1 commit intoportphp:masterfrom
Conversation
|
@ddeboer ping :) |
|
Hey @lsmith77, nice addition! But i'm not really sure if a 5th parameter is such a good design. |
|
@Baachi how to handle BC in such a case? Maybe adding a factory method for the different use cases? |
Good idea: see #11. While it is a slight BC break, I’m okay with removing the So @lsmith77, could you please add a test case? |
|
Possibly fixes portphp/portphp#50. |
This is an untested change and the PR is more meant to start a discussion on this since this is kind of a BC break.
Inside the class itself the following code uses the
lookupFields:The else case would now of course never be reached. Now
$indexdefaults tonullin the constructor. We could of course make it even more flexible by optionally also supporting abooleanto determine if to use the old approach or if to use the new approach added in this PR.wdyt?