From 529ed1dd1dca1565cdeaf6a83c41c270139b4d54 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Tue, 13 Apr 2010 01:50:15 +0000 Subject: [PATCH] MINOR: niced the way MultiEnums call requireField to give alternative adapter access (from r98043) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102570 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/model/fieldtypes/MultiEnum.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/model/fieldtypes/MultiEnum.php b/core/model/fieldtypes/MultiEnum.php index 86bbe1aad..652fbe56f 100755 --- a/core/model/fieldtypes/MultiEnum.php +++ b/core/model/fieldtypes/MultiEnum.php @@ -31,8 +31,10 @@ class MultiEnum extends Enum { } function requireField(){ - $defaultClause = $this->default ? " default '". Convert::raw2sql($this->default) . "'" : ""; - DB::requireField($this->tableName, $this->name, "set('" . implode("','", $this->enum) . "') character set utf8 collate utf8_general_ci$defaultClause"); + + $values=array('type'=>'set', 'parts'=>array('enums'=>$this->enum, 'character set'=>'utf8', 'collate'=> 'utf8_general_ci', 'default'=>Convert::raw2sql($this->default), 'table'=>$this->tableName, 'arrayValue'=>$this->arrayValue)); + DB::requireField($this->tableName, $this->name, $values); + }