[Entity][Field] Manage the "compouned key" system of Mysql #4
Labels
Milestone
Comments
As discussed, we'll use for this use a master "PrimaryKey" class that will be iinherited. So that MyEntity will be associated to a MyEntityId extends PrimaryKey. PrimaryKey will provide services like check on each values. findById() signature will move to findById(&Entity $myEntity, mixed $id) With $id type either string (main use) or PrimaryKey. |
implementation on the branch composite primary key is over. the tests with a real project are in progress. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Actually, Orm doesn't allow us to use compouned keys.
Current code consider PK as a single field.
I'd prefer Entity::pk to be an array (or single value OR array, managed by "is_array" inside the code, but easier is to have array type).
As getPk() doesn't have to return "the name of the field that is PK", but "all fields making part of the PK".
must change to something like:
It should be nice to have helper managing this logic:
So that Core::deleteByIds(), Core::updateEntity(), Core::findByIds() can use it.
become
Entity::getPKWhere() manage so internal cache avoiding function calls.
The text was updated successfully, but these errors were encountered: