Documentation

FormWrapper
in package

Table of Contents

Constants

BUILT  = 3
CONSTRUCTED  = 0
PREPROCESSED  = 1
SUBMITTED  = 5
VALIDATED  = 4

Properties

$form  : CRM_Core_Form
$subsequentForms  : array<string|int, CRM_Core_Form>
$exception  : mixed
$formController  : CRM_Import_Controller|CRM_Core_Controller|CRM_Event_Controller_Registration
$formValues  : array<string|int, mixed>
$mail  : mixed
$mailSpoolID  : mixed
$originalMailSetting  : mixed
$output  : mixed
$redirects  : mixed
$templateVariables  : mixed
$validation  : array<string|int, mixed>|bool

Methods

__call()  : mixed
Call a function declared as externally accessible on the form.
__construct()  : mixed
addSubsequentForm()  : $this
Add another form to process.
checkTemplateVariable()  : void
getDeprecatedProperty()  : mixed
Retrieve a deprecated property, ensuring a deprecation notice is thrown.
getException()  : Exception
getFirstMail()  : array<string|int, mixed>
getFirstMailBody()  : string
getMail()  : null|array<string|int, mixed>
getMailCount()  : int
Get the number of emails sent.
getTemplateVariable()  : mixed
Get a variable assigned to the template.
getTemplateVariables()  : array<string|int, mixed>
getValidationOutput()  : array<string|int, mixed>|bool
postProcess()  : $this
Call form post process function.
processForm()  : FormWrapper
Process a CiviCRM form.
setFormObject()  : void
Instantiate form object.
startTrackingMail()  : void
Start tracking any emails sent by this form.
stopTrackingMail()  : void
Store any mails sent & revert to pre-test behaviour.

Constants

Properties

$formValues

private array<string|int, mixed> $formValues

$originalMailSetting

private mixed $originalMailSetting

$validation

private array<string|int, mixed>|bool $validation

Methods

__call()

Call a function declared as externally accessible on the form.

public __call(string $name, array<string|int, mixed> $arguments) : mixed

This will only call a limited number of form functions that are either a) supported from use from outside of core or b) direct form flow functions

As this class is expected to be used in extension tests we don't want to perpetuate the current issue with internal / unsupported properties being accessed willy nilly - so this provides testing support using supported or intrinsic functions only.

Parameters
$name : string
$arguments : array<string|int, mixed>
Tags
throws
CRM_Core_Exception
throws
ReflectionException

__construct()

public __construct(string $formName[, array<string|int, mixed> $formValues = [] ][, array<string|int, mixed> $urlParameters = [] ]) : mixed
Parameters
$formName : string
$formValues : array<string|int, mixed> = []
$urlParameters : array<string|int, mixed> = []

addSubsequentForm()

Add another form to process.

public addSubsequentForm(string $formName[, array<string|int, mixed> $formValues = [] ]) : $this
Parameters
$formName : string
$formValues : array<string|int, mixed> = []
Return values
$this

checkTemplateVariable()

public checkTemplateVariable(string $name, mixed $value) : void
Parameters
$name : string
$value : mixed
Tags
throws
CRM_Core_Exception

getDeprecatedProperty()

Retrieve a deprecated property, ensuring a deprecation notice is thrown.

public getDeprecatedProperty(string $property) : mixed
Parameters
$property : string
Tags
throws
CRM_Core_Exception

getException()

public getException() : Exception
Return values
Exception

getFirstMail()

public getFirstMail() : array<string|int, mixed>
Return values
array<string|int, mixed>

getFirstMailBody()

public getFirstMailBody() : string
Return values
string

getMail()

public getMail() : null|array<string|int, mixed>
Return values
null|array<string|int, mixed>

getMailCount()

Get the number of emails sent.

public getMailCount() : int
Return values
int

getTemplateVariable()

Get a variable assigned to the template.

public getTemplateVariable(mixed $string) : mixed
Parameters
$string : mixed

getTemplateVariables()

public getTemplateVariables() : array<string|int, mixed>
Return values
array<string|int, mixed>

getValidationOutput()

public getValidationOutput() : array<string|int, mixed>|bool
Return values
array<string|int, mixed>|bool

postProcess()

Call form post process function.

public postProcess() : $this
Return values
$this

processForm()

Process a CiviCRM form.

public processForm([int $state = self::SUBMITTED ]) : FormWrapper
Parameters
$state : int = self::SUBMITTED
Return values
FormWrapper

setFormObject()

Instantiate form object.

private setFormObject(string $class[, array<string|int, mixed> $formValues = [] ][, array<string|int, mixed> $urlParameters = [] ]) : void

We need to instantiate the form to run preprocess, which means we have to trick it about the request method.

Parameters
$class : string

Name of form class.

$formValues : array<string|int, mixed> = []
$urlParameters : array<string|int, mixed> = []

startTrackingMail()

Start tracking any emails sent by this form.

private startTrackingMail() : void
Tags
noinspection

PhpUnhandledExceptionInspection

stopTrackingMail()

Store any mails sent & revert to pre-test behaviour.

private stopTrackingMail() : void
Tags
noinspection

PhpUnhandledExceptionInspection


        
On this page

Search results