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:
Sam Minnee 2009-11-05 01:14:17 +00:00
parent 8633b648a2
commit c4581f741a

View File

@ -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}'");
}