Add Field::fromClass() #100

Open
opened 2026-10-28 15:36:09 +01:00 by c.fahner · 0 comments
Owner

Currently it is not possible to obtain the field definition for a single field without evaluating the entire Schema. For the implementation of subqueries (#93) it would be more efficient to query only one (or a few) fields from a given class at a time.

A static method Field::fromClass($class, $fields) should be introduced to make this possible. The $fields parameter should allow either a single non-empty-string (returns a single Field) or a non-empty-list<non-empty-string> (returns a map of Field's).

Currently it is not possible to obtain the field definition for a single field without evaluating the entire Schema. For the implementation of subqueries (#93) it would be more efficient to query only one (or a few) fields from a given class at a time. A static method `Field::fromClass($class, $fields)` should be introduced to make this possible. The `$fields` parameter should allow either a single `non-empty-string` (returns a single `Field`) or a `non-empty-list<non-empty-string>` (returns a map of `Field`'s).
c.fahner added this to the v0.3 milestone 2026-10-28 15:36:09 +01:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Blocks
Reference
slendium/ocd#100
No description provided.