Last active
December 16, 2015 21:39
-
-
Save gbili/5501490 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function getSqlDeclaration(array $fieldDeclaration, AbstractPlatform $platform) | |
{ | |
$values = array_map(function($val) { | |
return "'".$val."'"; | |
}, $this->values); | |
return "ENUM(".implode(", ", $values).") COMMENT '(DC2Type:".$this->name.")'"; | |
} | |
// BECOMES... | |
public function getSqlDeclaration(array $fieldDeclaration, AbstractPlatform $platform) | |
{ | |
$values = array_map(function($val) { | |
return "'$val'"; | |
}, $this->values); | |
return 'ENUM(' . implode(', ', $values) . ") COMMENT '(DC2Type:{$this->name})'"; | |
} | |
// OR JUST SHORTER... | |
public function getSqlDeclaration(array $fieldDeclaration, AbstractPlatform $platform) | |
{ | |
return "ENUM('" . implode("', '", $this->values) . "') COMMENT '(DC2Type:{$this->name})'"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment