Oihana PHP System

customerKey.php

Table of Contents

Functions

customerKey()  : null|int|string
Returns the customer organization key an authenticated account is a contact for.

Functions

customerKey()

Returns the customer organization key an authenticated account is a contact for.

customerKey(User $user) : null|int|string

Resolves the account's first CustomerEmployee business identity and returns the _key of the organization it works for (subject.worksFor) — the pivot used to scope a customer contact's resources (e.g. invoices or pricing conditions of that customer). A contact works for a single customer, so a single key is returned.

Parameters
$user : User

The authenticated account, with its identities hydrated.

Tags
example
use function xyz\oihana\schema\helpers\pivots\customerKey;

$key = customerKey( $currentUser ) ; // e.g. '137285125' or null
Return values
null|int|string

The customer organization _key, or null when the account has no customer-contact identity.

On this page

Search results