Moo\HasOneSelector\Form\Field
Class Field provides CMS field to manage selecting/adding/editing object within has_one relation of the current object being edited
Synopsis
class Field
extends GridField
{
- // members
- protected $dataClass;
- protected DataObject $owner;
- protected string $emptyString = 'No item selected';
- // methods
- public void __construct()
- public $this setEmptyString()
- public $this setDataClass()
- public string getDataClass()
- public DataObject|null getRecord()
- public void setRecord()
- public $this setOwner()
- public DataObject getOwner()
- public SS_List getList()
- public SS_List getManipulatedList()
- protected string getOptionalTableBody()
Hierarchy
Extends
- SilverStripe\Forms\GridField\GridField
Members
protected
- $dataClass
—
string
Name of the list data class - $emptyString
—
string
Text to display when no record selected - $owner
—
SilverStripe\ORM\DataObject
Instance of data object that contains the has one relation
Methods
protected
public
- __construct() — HasOneSelectorField constructor.
- getDataClass() — Get the name of the data class for current list
- getList() — Get the data source.
- getManipulatedList() — Get the data source after applying every {@link GridField_DataManipulator} to it.
- getOwner() — Get instance of data object that has the has one relation
- getRecord() — Get the record of the has one relation for current owner object
- setDataClass() — set the name of the data class for current list
- setEmptyString() — Set empty string when no record selected
- setOwner() — Set instance of data object that has the has one relation
- setRecord() — Set the record of the has one relation for current owner object