SilverCart\Model\Forms\FormField
Custom form field.
- Author: Sebastian Diel <sdiel@pixeltricks.de>
- Copyright: 2021 pixeltricks GmbH
- License: see license file in modules root directory
Synopsis
class FormField
extends DataObject
{
- // members
- private static string $table_name = 'SilverCart_Forms_FormField';
- private static array $db = ;
- private static array $casting = ;
- private static array $has_one = ;
- private static array $has_many = ;
- private static string $default_sort = 'Sort';
- private static array $summary_fields = ;
- private static array $extensions = ;
- private static bool $insert_translation_cms_fields = true;
- private static string $insert_translation_cms_fields_before = 'DefaultValue';
- protected static array $customFormData = ;
- // methods
- public static void setCustomFormData()
- public static array getCustomFormData()
- public static void getFormFieldCMSFields()
- public string singular_name()
- public string plural_name()
- public array fieldLabels()
- public FieldList getCMSFields()
- public FormFieldValidator getCMSValidator()
- protected void onBeforeWrite()
- public string getTitle()
- public string getDescription()
- public array getAllowedFormFieldTypes()
- protected void beforeUpdateAllowedFormFieldTypes()
- public string getFormFieldValue()
- public array getPresetWithSource()
- public string getTypeLabel()
- public FormField getFormField()
- public string generateFormFieldName()
- public bool validFormFieldName()
- public DBHTMLText forTemplate()
- // Inherited methods from ExtensibleDataObject
- protected void beforeRequireDefaultRecords()
- protected void beforeUpdateCMSActions()
- protected void beforeUpdateFieldLabels()
- protected void beforeUpdateProvidePermissions()
- public array defaultFieldLabels()
- public static void reset_field_labels()
- protected array scaffoldFieldLabels()
Hierarchy
Members
private
- $casting
—
array
Casted attributes. - $db
—
array
DB attributes. - $default_sort
—
string
Default sort - $extensions
—
array
Extensions. - $has_many
—
array
Has one relations. - $has_one
—
array
Has one relations. - $insert_translation_cms_fields
—
SilverCart\Model\Forms\bool
Determines to insert the translation CMS fields automatically. - $insert_translation_cms_fields_before
—
string
Field name to insert the translation CMS fields after. - $summary_fields
—
array
Summary fields. - $table_name
—
string
DB table name
protected
- $customFormData
—
array
Custom form data. - $defaultFieldLabels
—
array
Default field labels.
Methods
protected
- beforeUpdateAllowedFormFieldTypes() — Allows user code to hook into DataObject::getAllowedFormFieldTypes prior to updateAllowedFormFieldTypes being called on extensions.
- onBeforeWrite() — On before write.
public
- fieldLabels() — Field labels for display in tables.
- forTemplate() — Returns the rendered form field.
- generateFormFieldName() — Generates and returns the form field name.
- getAllowedFormFieldTypes() — Returns the allowed form field types.
- getCMSFields() — Returns the CMS fields.
- getCMSValidator() — Returns the custom FormFieldValidator to use for CMS field validation.
- getCustomFormData() — Returns the custom form data.
- getDescription() — Returns the translated Description.
- getFormField() — Returns the form field object.
- getFormFieldCMSFields() — Adds the blacklist management fields to the given CMS $fields.
- getFormFieldValue() — Returns the form field value.
- getPresetWithSource() — Returns the dropdown source.
- getTitle() — Returns the translated title.
- getTypeLabel() — Returns the type label.
- plural_name() — Returns the translated plural name.
- setCustomFormData() — Sets the custom form data.
- singular_name() — Returns the translated singular name.
- validFormFieldName() — Returns true if this object has a Name value that does not conflict with any other objects.
Inherited from SilverCart\ORM\ExtensibleDataObject
protected
- beforeRequireDefaultRecords() — Allows user code to hook into DataObject::requireDefaultRecords() prior to requireDefaultRecords being called on extensions.
- beforeUpdateCMSActions() — Allows user code to hook into DataObject::getCMSActions prior to updateCMSActions being called on extensions.
- beforeUpdateFieldLabels() — Allows user code to hook into DataObject::fieldLabels() prior to updateFieldLabels being called on extensions.
- beforeUpdateProvidePermissions() — Allows user code to hook into DataObject::updateProvidePermissions() prior to providePermissions being called on extensions.
- scaffoldFieldLabels() — Returns the default field labels for this DataObject.
public
- defaultFieldLabels() — Returns the default field labels.
- reset_field_labels() — Resets the field label cache.