Search by

phramecms / entity

TLyngeJ

Dynamic Entity Types, Bundles, reusable Field Storage & Field Instances, pluggable Field Types, Revisions, and Editorial Workflow States for PhrameCMS.

Package info

github.com/PhrameCMS/entity

pkg:composer/phramecms/entity

Statistics

Installs: 32

Dependents: 4

Suggesters: 1

Stars: 0

Open Issues: 0

v0.1.0 2026-12-04 21:11 UTC

This package is auto-updated.

Last update: 2026-12-04 21:34:49 UTC


README

Dynamic Entity and Drupal-inspired Field module for PhrameCMS.

Responsibilities

  • Config-Driven Entity Types & Bundles: Define entity types (e.g., content, media, taxonomy_term) and bundles (e.g., article, page, product) as validated configuration objects in phramecms/config.
  • Drupal-Inspired Field Architecture:
    • FieldStorage: Reusable field definition (field type, storage settings, cardinality 1, N, or unlimited) shared across bundles of an entity type.
    • FieldInstance: Bundle-specific attachment with label, description, required flag, default value, validation constraints, and API exposure metadata.
  • Pluggable Field Types (via phrame.field_type service tag):
    • Built-in types: string, text (formatted/markdown), integer, float, boolean, datetime, json, slug, and entity_reference.
    • Each field type declares its own storage column schema, normalization/denormalization logic, validation rules, and JSON Schema fragment.
  • Revisions & Editorial Workflow:
    • Immutable revision history for every entity change with author/agent attribution and revision log message.
    • Built-in workflow states (draft, in_review, published, archived) so AI agents can be constrained to drafting without auto-publishing.
  • Registered Operations: Schema operations (entity_type.*, bundle.*, field_storage.*, field_instance.*) and content operations (entity.list, entity.get, entity.create, entity.update, entity.delete, entity.revisions, entity.transition) — all supporting validation and dry_run.

AI-First Design Role

Every bundle dynamically compiles a complete JSON Schema from its attached FieldInstance definitions. When an AI agent (or human) adds a field to a bundle, the REST API, OpenAPI 3.1 spec, MCP tools/resources, and CLI immediately reflect the updated schema.

Dependencies

  • PHP ^8.5
  • phramecms/core
  • phramecms/database
  • phramecms/config

Ecosystem

Part of the PhrameCMS multi-repo suite. See PhrameCMS/cms for the starter distribution and architecture docs.