mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX: Allow null default on MultiEnum fields
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@90850 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
8633b648a2
commit
c4581f741a
@ -11,6 +11,13 @@
|
||||
* @subpackage model
|
||||
*/
|
||||
class MultiEnum extends Enum {
|
||||
function __construct($name, $enum = NULL, $default = NULL) {
|
||||
parent::__construct($name, $enum, $default);
|
||||
|
||||
// MultiEnums are allowed blank defaults
|
||||
if(!$default) $this->default = $default;
|
||||
}
|
||||
|
||||
function requireField(){
|
||||
DB::requireField($this->tableName, $this->name, "set('" . implode("','", $this->enum) . "') character set utf8 collate utf8_general_ci default '{$this->default}'");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user