Added better support for attributes generation in doctrine records
This commit is contained in:
parent
872c81cb5a
commit
2ff1dcadc5
@ -455,6 +455,11 @@ END;
|
|||||||
{
|
{
|
||||||
$build = "\n";
|
$build = "\n";
|
||||||
foreach ($attributes as $key => $value) {
|
foreach ($attributes as $key => $value) {
|
||||||
|
|
||||||
|
if (is_bool($value))
|
||||||
|
{
|
||||||
|
$values = $value ? 'true':'false';
|
||||||
|
} else {
|
||||||
if ( ! is_array($value)) {
|
if ( ! is_array($value)) {
|
||||||
$value = array($value);
|
$value = array($value);
|
||||||
}
|
}
|
||||||
@ -466,6 +471,7 @@ END;
|
|||||||
|
|
||||||
// Trim last ^
|
// Trim last ^
|
||||||
$values = substr($values, 0, strlen($values) - 3);
|
$values = substr($values, 0, strlen($values) - 3);
|
||||||
|
}
|
||||||
|
|
||||||
$build .= "\t\t\$this->setAttribute(Doctrine::ATTR_" . strtoupper($key) . ", " . $values . ");\n";
|
$build .= "\t\t\$this->setAttribute(Doctrine::ATTR_" . strtoupper($key) . ", " . $values . ");\n";
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user