Core Concepts
Contacts runs lazily ('autoload' => false, 'singular' => true) and stores all directory records in Entries with zero custom SQL tables. Resolve the service via Contacts::instance($this) or Contacts::requireInstance($this).
Directory Architecture
Section titled “Directory Architecture”flowchart TB Org["OrganizationEntry\n(contacts-organizations)"] <-->|"Pivot: contacts-membership"| Contact["ContactEntry\n(contacts-contacts)"] Contact --> Channels["contacts-channel\n(9 ChannelTypes)"] Contact --> Addresses["contacts-address\n(7 AddressTypes)"] Contact --> Consents["contacts-consent\n(5 ConsentPurposes)"] Contact --> Notes["contacts-notes\n(Timeline & Follow-Ups)"] Contact --> Taxonomy["contacts-roles & contacts-tags"] Contact -.->|"contactsParticipant hooks"| Downstream["Downstream Modules\n(Merge · Timeline · GDPR)"]
All 13 ContactsBlueprints
Section titled “All 13 ContactsBlueprints”| Constant | Blueprint Handle | Kind | Visibility | Purpose |
|---|---|---|---|---|
TYPE_SETTINGS |
contacts-settings |
single |
Hidden | Global defaults, dedupe strategy, sync toggles, retention window (revisions: 10). |
TYPE_CONTACTS |
contacts-contacts |
collection |
Hidden | People records hydrated as ContactEntry (revisions: 15, 7 editor tabs). |
TYPE_ORGANIZATIONS |
contacts-organizations |
collection |
Hidden | Companies, agencies, brokerages, suppliers hydrated as OrganizationEntry (revisions: 15, 7 tabs). |
TYPE_NOTES |
contacts-notes |
collection |
Hidden | Interaction notes and scheduled follow-ups (revisions: 10, sluggable: false, sort -occurred_at). |
TYPE_ROLES |
contacts-roles |
collection |
Hidden | Vertical directory roles (unique code, such as broker, crew, lead). |
TYPE_TAGS |
contacts-tags |
collection |
Hidden | Canonical segmentation tags (unique code, color swatch) synced with import/export groups. |
TYPE_CHANNEL |
contacts-channel |
block |
Hidden | Repeatable communication channels (ChannelType), RBAC-gated. |
TYPE_ADDRESS |
contacts-address |
block |
Hidden | Repeatable addresses (AddressType) with billing/shipping defaults, RBAC-gated. |
TYPE_CONSENT |
contacts-consent |
block |
Hidden | Append-only purpose-scoped consent ledger (ConsentPurpose), contacts-admin delete. |
TYPE_MEMBERSHIP |
contacts-membership |
block |
Hidden | Pivot memberships linking contacts to organizations with role/department/primary flag. |
FIELDSET_PROFILE |
contacts-profile |
fieldset |
Public | Composable user/page profile fieldset (contacts_profile preset). |
FIELDSET_ORGANIZATION |
contacts-organization |
fieldset |
Public | Composable organization fieldset (contacts_organization preset). |
FIELDSET_MEMBERSHIPS |
contacts-memberships |
fieldset |
Public | Composable memberships fieldset (contacts_memberships preset). |
Typed Entities (AbstractDirectoryEntry)
Section titled “Typed Entities (AbstractDirectoryEntry)”Both ContactEntry and OrganizationEntry extend AbstractDirectoryEntry (which extends EntryItem), exposing typed read helpers without manual casting:
- Shared (
AbstractDirectoryEntry):displayTitle(),primaryEmail(),phoneE164(),countryCode(),timezone(),statusKey(),ownerUserId(),channels(),addresses(),primaryAddress(),defaultBillingAddress(),defaultShippingAddress(),roleCodes(),tagCodes(),domainMeta($key, $default),externalRef($key). ContactEntry:salutation(),firstName(),lastName(),fullName(),jobTitle(),preferredLanguage(),isAnonymized(),doNotContact(),marketingOptIn(),linkedUserId(),primaryOrganization(),primaryOrganizationId(),memberships(),consents().OrganizationEntry:legalName(),orgType(),website(),taxId(),taxOffice(),registrationNo(),billingEmail(),defaultCurrency(),paymentTermsDays(),parentOrganization(),parentOrganizationId().
ContactNormalizer Invariants
Section titled “ContactNormalizer Invariants”ContactNormalizer hooks Entries::saveReady on both single save() and batch saveMany() operations so data stays consistent no matter where a write originates:
- Lowercases and trims email addresses (
normalizeEmail()). - Normalizes phone numbers to E.164 format using the record’s country or
default_country_code(normalizePhone()). - Enforces at most one
is_primarychannel per type, oneis_primaryaddress, oneis_default_billingaddress, and oneis_default_shippingaddress. - Prevents circular
parent_organizationchains on organizations. - Synchronizes
contacts-membershippivot rows withprimary_organization. - Protects
gdpr_anonymized_at, append-onlycontacts-consentwrites, and trustedlinked_user_idbindings behind scoped internal gates (runAsAnonymizer,runAsSystemConsentWriter,runAsUserLinker).