diff --git a/docs/en/02_Developer_Guides/00_Model/02_Relations.md b/docs/en/02_Developer_Guides/00_Model/02_Relations.md index b3cb2bd1c..83ddbbae3 100644 --- a/docs/en/02_Developer_Guides/00_Model/02_Relations.md +++ b/docs/en/02_Developer_Guides/00_Model/02_Relations.md @@ -147,7 +147,7 @@ you will get an instance of [api:HasManyList] rather than the object. echo $player->FirstName; } -To specify multiple $has_manys to the same object you can use dot notation to distinguish them like below: +To specify multiple `$has_many` to the same object you can use dot notation to distinguish them like below: :::php removeByName(array('ManagerID', 'CleanerID')); + return $fields; + } + ## belongs_to Defines a 1-to-1 relationship with another object, which declares the other end of the relationship with a -corresponding $has_one. A single database column named `ID` will be created in the object with the +corresponding `$has_one`. A single database column named `ID` will be created in the object with the `$has_one`, but the $belongs_to by itself will not create a database field. This field will hold the ID of the object declaring the `$belongs_to`. -Similarly with $has_many, dot notation can be used to explicitly specify the `$has_one` which refers to this relation. +Similarly with `$has_many`, dot notation can be used to explicitly specify the `$has_one` which refers to this relation. This is not mandatory unless the relationship would be otherwise ambiguous. :::php diff --git a/forms/CheckboxSetField.php b/forms/CheckboxSetField.php index e72b1f516..55eb8cf2b 100644 --- a/forms/CheckboxSetField.php +++ b/forms/CheckboxSetField.php @@ -54,9 +54,7 @@ class CheckboxSetField extends OptionsetField { 'Options' => $this->getOptions() )); - return $this->customise($properties)->renderWith( - $this->getTemplates() - ); + return FormField::Field($properties); } /** diff --git a/forms/ListboxField.php b/forms/ListboxField.php index 0989da05c..d8aac5b0f 100644 --- a/forms/ListboxField.php +++ b/forms/ListboxField.php @@ -102,7 +102,7 @@ class ListboxField extends DropdownField { 'Options' => new ArrayList($options) )); - return $this->customise($properties)->renderWith($this->getTemplates()); + return FormField::Field($properties); } public function getAttributes() { diff --git a/forms/OptionsetField.php b/forms/OptionsetField.php index eb7fea930..98ade1de5 100644 --- a/forms/OptionsetField.php +++ b/forms/OptionsetField.php @@ -83,9 +83,7 @@ class OptionsetField extends DropdownField { 'Options' => new ArrayList($options) )); - return $this->customise($properties)->renderWith( - $this->getTemplates() - ); + return FormField::Field($properties); } /** diff --git a/forms/TreeDropdownField.php b/forms/TreeDropdownField.php index abd622792..d3a7cbc8c 100644 --- a/forms/TreeDropdownField.php +++ b/forms/TreeDropdownField.php @@ -248,7 +248,7 @@ class TreeDropdownField extends FormField { ) ); - return $this->customise($properties)->renderWith('TreeDropdownField'); + return parent::Field($properties); } public function extraClass() { diff --git a/forms/TreeMultiselectField.php b/forms/TreeMultiselectField.php index 5f0f7f302..1f3965f1a 100644 --- a/forms/TreeMultiselectField.php +++ b/forms/TreeMultiselectField.php @@ -135,7 +135,7 @@ class TreeMultiselectField extends TreeDropdownField { 'Value' => $value ) ); - return $this->customise($properties)->renderWith('TreeDropdownField'); + return FormField::Field($properties); } /** diff --git a/forms/UploadField.php b/forms/UploadField.php index dc5f18675..847ecd25c 100644 --- a/forms/UploadField.php +++ b/forms/UploadField.php @@ -974,11 +974,11 @@ class UploadField extends FileField { } $mergedConfig = array_merge($config, $this->ufConfig); - return $this->customise(array( + return parent::Field(array( 'configString' => str_replace('"', """, Convert::raw2json($mergedConfig)), 'config' => new ArrayData($mergedConfig), 'multiple' => $allowedMaxFileNumber !== 1 - ))->renderWith($this->getTemplates()); + )); } /**