Use category_id in DataFieldForm
This commit is contained in:
parent
575fa88518
commit
19d43fae5d
|
@ -164,6 +164,11 @@ class DirectorDatafieldForm extends DirectorObjectForm
|
|||
'rows' => '3',
|
||||
));
|
||||
|
||||
$this->addElement('select', 'category_id', [
|
||||
'label' => $this->translate('Data Field Category'),
|
||||
'multiOptions' => $this->optionalEnum($this->enumCategpories()),
|
||||
]);
|
||||
|
||||
$error = false;
|
||||
try {
|
||||
$types = $this->enumDataTypes();
|
||||
|
@ -285,4 +290,12 @@ class DirectorDatafieldForm extends DirectorObjectForm
|
|||
|
||||
return $enum;
|
||||
}
|
||||
|
||||
protected function enumCategpories()
|
||||
{
|
||||
$db = $this->getDb()->getDbAdapter();
|
||||
return $db->fetchPairs(
|
||||
$db->select()->from('director_datafield_category', ['id', 'category_name'])
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue