Entity references, indexes and constraints #85
No reviewers
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: 1 hour 14 minutes
Due date
c.fahner
1 hour 14 minutes
No due date set.
Dependencies
No dependencies set
Reference
slendium/ocd!85
Loading…
Reference in a new issue
No description provided.
Delete branch "issues/5"
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?
Resolves #5
Adds relationships between entities (in the form of Reference constraints)
Adds custom primary fields for non-entities
Adds class- and field-level indexes
Adds class- and field-level unique constraints
Adds invariant constraints
Adds auto-expiring documents
Removes field renaming
WIP: Entity references, indexes and constraintsto Entity references, indexes and constraints@ -19,0 +49,4 @@** Adding the {@see Schema\Constraint\Reference} attribute to a class directly allows creating more* complex relationships.* To override the default options for a single field use the {@see Field\Reference} attribute.{@see Schema\Field\Reference}(theFieldclass is not imported directly)@ -0,0 +11,4 @@** Constraints are declared at the top of the class for which to generate a schema.* You can also declare a single field as unique using the field-specific {@see Field\Unique} attribute.* Declaring a single field as unique will automatically add it as a constraint of the entire schema."...
ofto the entire schema."@ -0,0 +20,4 @@** ```php* #[Schema\Constraint\Unique([ 'category', 'position' ])]* #[Schema\Constraint\Invariant(static fn() => new Predicate\GreaterThan(new FieldPath([ 'price' ]), 0))]Invalid syntax,
function() { }has to be written in full (or replace with a const)@ -0,0 +8,4 @@use Slendium\Ocd\Schema\Constraint\ConstraintAction;/*** Contains overrides for the options of an implied field reference."Overrides the default options of an implied field reference."
@ -0,0 +21,4 @@use MarkerAttribute;/*** @param ReflectionClass<object> $reflectorMissing
@internal@ -0,0 +40,4 @@throw DefinitionException::forTooManyTypes($parameter);}return ($typeAttrs[0] ?? null)?->newInstance()Directly use ternary?:
isset(...) ? ...->newInstance() : getImplied