Documentation

CRM_Contact_Form_ContactFormTrait

Trait implements getContactValue + overridable getContactID functions.

These are commonly used on forms - although getContactID() would often be overridden. By using these functions it is not necessary to know if the Contact ID has already been defined as getContactID() will retrieve them form the values available (unless it is yet to be created).

Table of Contents

Methods

getContactID()  : int|null
Get the contact ID.
getContactValue()  : mixed
Get a value for the contact being acted on in the form.

Methods

getContactID()

Get the contact ID.

public getContactID() : int|null

Override this for more complex retrieval as required by the form.

Tags
noinspection

PhpUnhandledExceptionInspection

noinspection

PhpDocMissingThrowsInspection

Return values
int|null

getContactValue()

Get a value for the contact being acted on in the form.

public getContactValue(mixed $fieldName) : mixed

This can be called from any point in the form flow and if the contact can not yet be determined it will return NULL.

Parameters
$fieldName : mixed
Tags
throws
CRM_Core_Exception

        
On this page

Search results