Make all entities identifiable #46
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Research
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No project
No assignees
1 participant
Notifications
Total time spent: 40 minutes
Due date
c.fahner
40 minutes
No due date set.
Dependencies
No dependencies set
Reference
slendium/ocd#46
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Currently entities have to opt-in to being identifiable (ie. having a unique 'id' field) by implementing the
Identifiableinterface. This results in code working with entities being littered withinstanceofchecks forIdentifiableeven though this is the most common case.The
Schemaobject already allows classes that are notEntity's, so forcing all entities to have an 'id' field does not make it impossible to make schemas from non-identifiable objects nor does it disallow referencing such objects from other schemas. What would need to change is the way non-entities are referenced by a foreign key, as theEntityinterface can't be used as a marker anymore.Therefor, the
Entity\Identifiableinterface should be merged with theEntityinterface to improve the common case.