FIX Update ORM DBField types to use Injector in scaffoldFormField()

- This is usable in cases where a DBField is needed to be overloaded through the Injector.
This commit is contained in:
mnuguid 2020-02-04 21:43:47 +13:00
parent 27517c55e7
commit ca36a47bb1
5 changed files with 6 additions and 6 deletions

View File

@ -56,7 +56,7 @@ class DBBoolean extends DBField
public function scaffoldFormField($title = null, $params = null)
{
return new CheckboxField($this->name, $title);
return CheckboxField::create($this->name, $title);
}
public function scaffoldSearchField($title = null)

View File

@ -203,7 +203,7 @@ class DBHTMLText extends DBText
public function scaffoldFormField($title = null, $params = null)
{
return new HTMLEditorField($this->name, $title);
return HTMLEditorField::create($this->name, $title);
}
public function scaffoldSearchField($title = null)

View File

@ -58,7 +58,7 @@ class DBInt extends DBField
public function scaffoldFormField($title = null, $params = null)
{
return new NumericField($this->name, $title);
return NumericField::create($this->name, $title);
}
public function nullValue()

View File

@ -246,10 +246,10 @@ class DBText extends DBString
{
if (!$this->nullifyEmpty) {
// Allow the user to select if it's null instead of automatically assuming empty string is
return new NullableField(new TextareaField($this->name, $title));
return NullableField::create(TextareaField::create($this->name, $title));
} else {
// Automatically determine null (empty string)
return new TextareaField($this->name, $title);
return TextareaField::create($this->name, $title);
}
}

View File

@ -20,7 +20,7 @@ class DBYear extends DBField
public function scaffoldFormField($title = null, $params = null)
{
$selectBox = new DropdownField($this->name, $title);
$selectBox = DropdownField::create($this->name, $title);
$selectBox->setSource($this->getDefaultOptions());
return $selectBox;
}