\MultiRecordField_Readonly
Synopsis
class MultiRecordField_Readonly
extends MultiRecordField
{
- // Inherited constants from MultiRecordField
- const SORT_INVALID = 0;
- const NEW_RECORD = 0;
- const NEW_LIST = 1;
- // members
- protected boolean $readonly = true;
- // Inherited members from MultiRecordField
- protected $config;
- protected SS_List $list;
- protected FieldList $actions;
- protected string $titleField;
- protected function|string $fieldsFunction;
- protected boolean $fieldsFunctionFallback;
- protected string $modelClassName;
- protected integer $htmlEditorHeight;
- protected string|array $sortFieldName;
- protected boolean $useToggles;
- protected boolean $preparedForRender;
- protected boolean $canAddInline;
- protected FieldList $children;
- protected string|null $buttonClasses;
- protected array $extraClasses;
- protected integer $depth;
- // methods
- public void handleRequest()
- public FieldList Actions()
- // Inherited methods from MultiRecordField
- public void __construct()
- public void handleAddInline()
- public void handleRequest()
- public MultiRecordField setUseToggles()
- public boolean getUseToggles()
- public MultiRecordField setCanAddInline()
- public boolean getCanAddInline()
- public string getButtonClasses()
- public MultiRecordField setButtonClasses()
- public MultiRecordField applyButtonClasses()
- public MultiRecordField setValue()
- public MultiRecordField getConfig()
- public MultiRecordField setConfig()
- public string getModelClass()
- public MultiRecordField setModelClass()
- public MultiRecordField setModelClasses()
- public array getModelClasses()
- public array getModelClassesOrThrowExceptionIfEmpty()
- public static array convert_to_associative()
- public void getFieldID()
- public SS_List getList()
- public MultiRecordField setList()
- public MultiRecordField setForm()
- public boolean getCanSort()
- public string getTitleField()
- public MultiRecordField setTitleField()
- public string getDefaultFieldsFunction()
- public function|string getFieldsFunction()
- public MultiRecordField setFieldsFunction()
- public FieldList|null getRecordDataFields()
- public string getActionURL()
- public MultiRecordField applyUniqueFieldNames()
- public string getUniqueFieldName()
- public void saveInto()
- public FieldList Fields()
- public FieldList Actions()
- public MultiRecordField_Readonly performReadonlyTransformation()
- public FieldList getChildren()
- public string getSortFieldName()
- public MultiRecordField setSortFieldName()
- protected static array sort_string_to_array()
- protected static array get_direction_from_string()
- protected void prepareForRender()
- public void FieldHolder()
- public void Field()
Hierarchy
Extends
Tasks
Line | Task |
---|---|
197 | (Jake): Change '->remaining' to '->shift(4)' and test. |
486 | (Jake): Improve API to allow multiple params (ie. setConfigFunction('HtmlEditorField', 'setRows', 6)) |
Constants
Name | Value |
---|---|
SORT_INVALID | 0 |
NEW_RECORD | 0 |
NEW_LIST | 1 |
Members
protected
- $actions — FieldList
- $canAddInline — boolean
- $children — FieldList
- $config
—
array
Defaults to default_config if not set. - $depth
—
int
How nested inside other MultiRecordField's this field is. - $extraClasses — array
- $fieldsFunction
—
function|string
Override the field function to call on the record. - $fieldsFunctionFallback
—
boolean
Whether to fallback on 'getDefaultFieldsFunction' if the $fieldsFunction is a string and doesn't exist on the record. - $htmlEditorHeight
—
int
Whether to override html editor heights - $list
—
SS_List
The list object passed into the object. - $modelClassName
—
string
Class name of the DataObject that the GridField will display. - $preparedForRender — boolean
- $readonly
- $sortFieldName
—
string|array
The field name to sort by. - $titleField
—
string
Field to use for the ToggleCompositeField's heading/title - $useToggles
—
boolean
Should we use toggle Composites in layout ?
Methods
public
Inherited from MultiRecordField
protected
- get_direction_from_string()
- prepareForRender() — Prepares everything just before rendering the field
- sort_string_to_array() — Parse sort string into an array of sorts
public
- Actions()
- Field()
- FieldHolder()
- Fields()
- applyButtonClasses() — Apply button classes to a fieldlist of actions
- applyUniqueFieldNames() — Re-write field names to be unique ie. 'Title' to be 'ElementArea__MultiRecordField__ElementGallery__Title'
- convert_to_associative() — Convert regular array to associative, making the key the classname and the value the pretty/front-facing name.
- getActionURL()
- getButtonClasses()
- getCanAddInline()
- getCanSort()
- getChildren()
- getConfig()
- getDefaultFieldsFunction() — Get the default function to call on the record if $this->fieldsFunction isn't set.
- getFieldID() — @return int|string
- getFieldsFunction() — Get closure or string of the function to call for getting record fields.
- getList()
- getModelClass() — Gets the first model class from list.
- getModelClasses()
- getModelClassesOrThrowExceptionIfEmpty()
- getRecordDataFields()
- getSortFieldName()
- getTitleField() — Get the field to use for the ToggleCompositeField's heading/title
- getUniqueFieldName()
- getUseToggles()
- handleAddInline()
- handleRequest()
- performReadonlyTransformation() — Returns a read-only version of this field.
- saveInto()
- setButtonClasses() — Set the classes to be applied on each FormAction field.
- setCanAddInline()
- setConfig()
- setFieldsFunction() — Set the function to call on the $record for determining what fields to show.
- setForm()
- setList()
- setModelClass() — Set one model class.
- setModelClasses() — If array, can be formatted like so: array('MyClass', 'MyOtherClass') -or- array('MyClass' => 'Nice Name 1', 'MyOtherClass' => 'Nice Name 2')
- setSortFieldName() — Set what field to use for sorting the records.
- setTitleField() — Set the field to use for the ToggleCompositeField's heading/title
- setUseToggles()
- setValue()