Documentation

CRM_Contribute_Form_ContributeFormTrait uses trait:short

Trait implements functions to retrieve contribution related values.

Table of Contents

Properties

$entityLookupDefinitions  : array<string|int, mixed>
Array of defined entity identifiers.
$entityLookupValues  : array<string|int, mixed>
Array of defined entity values.

Methods

getContributionID()  : int|null
Get the selected Contribution ID.
getContributionPageID()  : int|null
Get id of contribution page being acted on.
getContributionPageValue()  : mixed
Get a value from the contribution being acted on.
getContributionRecurID()  : int|null
Get the selected Contribution Recur ID.
getContributionRecurValue()  : mixed
Get the value for a field relating to the contribution recur record.
getContributionValue()  : mixed
Get the value for a field relating to the contribution.
isDefined()  : bool
Check if an entity can be looked up
lookup()  : mixed
Retrieve a field value for a defined entity
define()  : void
Defines a record so its values can be retrieved using `$this->lookup()`
getDefinition()  : array{entityName: string, identifier: array}|null
Retrieve entity definition (entityName string, identifier [keys/values])

Properties

$entityLookupDefinitions

Array of defined entity identifiers.

private array<string|int, mixed> $entityLookupDefinitions = []

$entityLookupValues

Array of defined entity values.

private array<string|int, mixed> $entityLookupValues = []

Methods

getContributionID()

Get the selected Contribution ID.

public getContributionID() : int|null
APIYes
Tags
noinspection

PhpUnhandledExceptionInspection

Return values
int|null

getContributionPageID()

Get id of contribution page being acted on.

public getContributionPageID() : int|null
APIYes
Tags
noinspection

PhpUnhandledExceptionInspection

Return values
int|null

getContributionPageValue()

Get a value from the contribution being acted on.

public getContributionPageValue(string $fieldName) : mixed
APIYes

All values returned in apiv4 format. Escaping may be required.

Parameters
$fieldName : string
Tags
noinspection

PhpUnhandledExceptionInspection

getContributionRecurID()

Get the selected Contribution Recur ID.

public getContributionRecurID() : int|null
APIYes
Tags
noinspection

PhpUnhandledExceptionInspection

Return values
int|null

getContributionRecurValue()

Get the value for a field relating to the contribution recur record.

public getContributionRecurValue(string $fieldName) : mixed
APIYes

All values returned in apiv4 format. Escaping may be required.

Parameters
$fieldName : string
Tags
throws
CRM_Core_Exception

getContributionValue()

Get the value for a field relating to the contribution.

public getContributionValue(string $fieldName) : mixed
APIYes

All values returned in apiv4 format. Escaping may be required.

Parameters
$fieldName : string
Tags
throws
CRM_Core_Exception

isDefined()

Check if an entity can be looked up

public isDefined(string $nickname) : bool
Parameters
$nickname : string
Return values
bool

lookup()

Retrieve a field value for a defined entity

public lookup(string $nickname, string $fieldName) : mixed
Parameters
$nickname : string

Handle set by $this->define()

$fieldName : string
Tags
throws
CRM_Core_Exception

define()

Defines a record so its values can be retrieved using `$this->lookup()`

protected define(string $apiEntityName, string $nickname, array<string|int, mixed> $identifier) : void
Parameters
$apiEntityName : string
$nickname : string

Handle to use to retrieve values with $this->lookup()

$identifier : array<string|int, mixed>

A unique key or combination of keys to uniquely identify the record (usually id) Most commonly looks like ['id' => 123]

getDefinition()

Retrieve entity definition (entityName string, identifier [keys/values])

protected getDefinition(string $nickname) : array{entityName: string, identifier: array}|null
Parameters
$nickname : string
Return values
array{entityName: string, identifier: array}|null

        
On this page

Search results