CRM_Core_Form_EntityFormTrait
trait CRM_Core_Form_EntityFormTrait
Properties
protected int | $_entitySubTypeId | The entity subtype ID (eg. for Relationship / Activity) |
Methods
Get entity fields for the entity to be added to the form.
Explicitly declare the form context.
Get entity fields for the entity to be added to the form.
Set the delete message.
Set entity fields to be assigned to the form.
Get the entity id being edited.
Should custom data be suppressed on this form.
Get the entity subtype ID being edited
If the custom data is in the submitted data (eg. added via ajax loaded form) add to form.
Build the form object.
Build the form for any deletion.
Add relevant buttons to the form.
Get the defaults for the entity.
Get the validation rule to apply to a function.
Set translated fields.
Add defined entity field to template.
Is the form being used in the context of a deletion.
Is the form being used in the context of a view.
No description
Details
at line 47
array
getEntityFields()
Get entity fields for the entity to be added to the form.
at line 54
getDefaultContext()
Explicitly declare the form context.
at line 63
string
getDeleteMessage()
Get entity fields for the entity to be added to the form.
at line 72
setDeleteMessage()
Set the delete message.
We do this from the constructor in order to do a translation.
at line 78
protected
setEntityFields()
Set entity fields to be assigned to the form.
at line 86
int|null
getEntityId()
Get the entity id being edited.
at line 95
protected bool
isSuppressCustomData()
Should custom data be suppressed on this form.
at line 106
int|null
getEntitySubTypeId($subTypeId)
Get the entity subtype ID being edited
at line 116
addCustomDataToForm()
If the custom data is in the submitted data (eg. added via ajax loaded form) add to form.
at line 129
buildQuickEntityForm()
Build the form object.
at line 151
protected
buildDeleteForm()
Build the form for any deletion.
at line 159
protected
addFormButtons()
Add relevant buttons to the form.
at line 187
protected
getEntityDefaults()
Get the defaults for the entity.
at line 228
protected string|int|bool
getValidationTypeForField(string $fieldName)
Get the validation rule to apply to a function.
Alphanumeric is designed to always be safe & for now we just return that but in future we can use tighter rules for types like int, bool etc.
at line 245
protected
setTranslatedFields()
Set translated fields.
This function is called from the class constructor, allowing us to set fields on the class that can't be set as properties due to need for translation or other non-input specific handling.
at line 265
protected
addEntityFieldsToTemplate()
Add defined entity field to template.
at line 283
protected bool
isDeleteContext()
Is the form being used in the context of a deletion.
(For some reason rather than having separate forms Civi overloads one form).
at line 292
protected bool
isViewContext()
Is the form being used in the context of a view.