Oihana PHP System

customerKeys.php

Table of Contents

Functions

customerKeys()  : array<int, int|string>
Returns every customer organization key an authenticated account is a contact for.

Functions

customerKeys()

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

customerKeys(User $user) : array<int, int|string>

Resolves all CustomerEmployee business identities of the account and returns, for each, the _key of the organization it works for (subject.worksFor) — the multi-valued pivot used to scope the resources of the customer(s) an account represents (e.g. the products priced for them). An account may be the contact of several customer organizations (e.g. the manager of two companies); this is the plural counterpart of customerKey().

Parameters
$user : User

The authenticated account, with its identities hydrated.

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

$keys = customerKeys( $currentUser ) ; // e.g. [ '137285125' , '137285130' ] or []
Return values
array<int, int|string>

The customer organization _key list (deduplicated, never null entries), or an empty array when the account has no customer-contact identity.

On this page

Search results