TheWebmen\PickerField\Controllers\HasOnePickerField::__construct
Usage [e.g. in getCMSFields] $field = new HasOnePickerField($this, 'DamID', 'Selected Dam', $this->Dam(), 'Select a Dam');
Signature
public function __construct(DataObject
$childObject,
string
$name,
[string
$title = NULL,
Object
$currentHasOne,
[string
$linkExistingTitle = NULL,
[
$searchContext = NULL]]] )
Parameters
$childObject
—
SilverStripe\ORM\DataObject
- - The DataObject we are manipulating with this field: typically $this via getCMSFields
$name
—
string
- - Field Name of has_one relationship (e.g. DamID, SireID, etc.): ensure 'ID' suffix
$title
—
string
- - GridField Title
$currentHasOne
—
object
- - Result of the current has_one relationship method (E.g. $this->HasOneMethod())
$linkExistingTitle
—
string
- - AddExisting Button Title
$searchContext
—