trait DAOActionTrait

Properties

protected string $language Specify the language to use if this is a multi-lingual environment.

Methods

CRM_Core_DAO|string
getBaoName()

No description

static array
baoToArray(object $bao)

Extract the true fields from a BAO

array|int
getObjects()

No description

fillDefaults(array $params)

Fill field defaults which were declared by the api.

array
writeObjects(array $items)

Write bao objects as part of a create/update action.

mixed
formatCustomParams(array $params, int $entityId)

No description

checkContactPermissions($baoName, $item)

Check edit/delete permissions for contacts and related entities.

string
getLanguage()

No description

setLanguage(string $language)

No description

Details

at line 61
protected CRM_Core_DAO|string getBaoName()

Return Value

CRM_Core_DAO|string

at line 73
static array baoToArray(object $bao)

Extract the true fields from a BAO

(Used by create and update actions)

Parameters

object $bao

Return Value

array

at line 88
protected array|int getObjects()

Return Value

array|int

at line 109
protected fillDefaults(array $params)

Fill field defaults which were declared by the api.

Note: default values from core are ignored because the BAO or database layer will supply them.

Parameters

array $params

at line 131
protected array writeObjects(array $items)

Write bao objects as part of a create/update action.

Parameters

array $items The records to write to the DB.

Return Value

array The records after being written to the DB (e.g. including newly assigned "id").

Exceptions

API_Exception

at line 214
protected mixed formatCustomParams(array $params, int $entityId)

Parameters

array $params
int $entityId

Return Value

mixed

at line 280
protected checkContactPermissions($baoName, $item)

Check edit/delete permissions for contacts and related entities.

Parameters

$baoName
$item

Exceptions

UnauthorizedException

at line 47
string getLanguage()

Return Value

string

at line 47
setLanguage(string $language)

Parameters

string $language