Contacts & Organizations
The core directory splits records into Contacts (contacts-contacts -> ContactEntry) and Organizations (contacts-organizations -> OrganizationEntry), connected by many-to-many Pivot Memberships (contacts-membership).
Contacts Directory & 7-Tab Editor
Section titled “Contacts Directory & 7-Tab Editor”Open Setup -> Contacts -> Contacts to search, filter by role, tag, or status, toggle Table/Cards layouts, or export CSV/JSON/vCard files.
Clicking a contact opens the 7-tab Contact Editor (Identity, Organizations & Roles, Privacy, Settings at top, plus Channels, Addresses, Consents, and Notes inline panels below):
Organizations Directory & Hierarchies
Section titled “Organizations Directory & Hierarchies”Open Setup -> Contacts -> Organizations to manage companies, agencies, brokerages, suppliers, and parent-subsidiary trees.
OrganizationType Enum Cases
Section titled “OrganizationType Enum Cases”Totoglu\Contacts\Domain\OrganizationType defines 8 canonical types: company, agency, brokerage, supplier, partner, family_office, government, and other.
Pivot Memberships (contacts-membership)
Section titled “Pivot Memberships (contacts-membership)”A single contact can belong to multiple organizations (for example, Claire Beaumont as Managing Broker at Riviera Yacht Brokerage and Advisory Board member at Mediterranean Fleet Operations). ContactNormalizer keeps primary_organization synchronized with the primary pivot membership row automatically, and blocks circular parent_organization chains on save.
Programmatic Lookup, Batching & Deduplicated Upsert
Section titled “Programmatic Lookup, Batching & Deduplicated Upsert”<?php
declare(strict_types=1);
namespace ProcessWire;
$contacts = Contacts::requireInstance($this);
// Fast single lookups$byPhone = $contacts->findContactByPhone('+33493550106', 'FR');$byUser = $contacts->findContactByUser($this->wire()->user);$org = $contacts->getOrganization('FR84912034512'); // UUID or Tax ID
// Batch hydration in caller order (avoids N+1 queries)$batch = $contacts->getContactsByIds([$byEmail->id]);
// Bounded directory queries (default limit: 50)$brokers = $contacts->findContacts('roles=broker, limit=25');$orgs = $contacts->findOrganizations('org_type=brokerage, limit=25');
// Provision or link a contact for a logged-in ProcessWire user$userContact = $contacts->ensureContactForUser($this->wire()->user);