Setyenv · Docs
  • English
  • Spanish
  • Chinese
  • Japanese
  • Arabic
  • German
  • French
  • Hindi
  • Indonesian
  • Italian
  • Dutch
  • Portuguese
  • Russian
  • Turkish

Entity

An entity is a user-defined record type. Think of it as roughly equivalent to a table in a database (but with typed fields, form + list designers, and event emission baked in).

What an entity owns

  • Slug — URL-safe identifier (contact, ticket, project). Used in REST routes and event names.
  • Singular / plural names — display labels.
  • Schema — a list of fields.
  • Form — the designer view for create/edit.
  • Lists — one or more list views.
  • Capabilities — what role can view / create / edit / delete.
  • Events — emitted automatically on every CRUD operation; consumable by WP-PFWorkflow.

Where it lives

Each entity gets its own database table (wp_pfm_<slug>). Field additions and removals are reconciled to the table by the Reconciler (see below).

Entity definitions themselves are stored in wp_pfm_entities as versioned JSON, so you can roll back a schema change.

Renaming and deleting entities

Renaming the singular / plural is free (no DB change). Renaming the SLUG is a destructive operation: it renames the DB table, all stored events, and all references in workflows. The Reconciler handles this via dry-run first; you see what will change before confirming.

Deleting an entity also goes through the Reconciler. By default it refuses if other entities have Relation fields pointing at this one (FK protection). Force with --no-fk-check only when you really mean it.