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
This commit is contained in:
Ingo Schommer 2010-04-13 01:50:15 +00:00
parent a2055d1d67
commit 529ed1dd1d

View File

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