Commit 2ff1dcad authored by Jonathan.Wage's avatar Jonathan.Wage

Added better support for attributes generation in doctrine records

parent 872c81cb
......@@ -455,18 +455,24 @@ END;
{
$build = "\n";
foreach ($attributes as $key => $value) {
if ( ! is_array($value)) {
$value = array($value);
}
if (is_bool($value))
{
$values = $value ? 'true':'false';
} else {
if ( ! is_array($value)) {
$value = array($value);
}
$values = '';
foreach ($value as $attr) {
$values .= "Doctrine::" . strtoupper($key) . "_" . strtoupper($attr) . ' ^ ';
$values = '';
foreach ($value as $attr) {
$values .= "Doctrine::" . strtoupper($key) . "_" . strtoupper($attr) . ' ^ ';
}
// Trim last ^
$values = substr($values, 0, strlen($values) - 3);
}
// Trim last ^
$values = substr($values, 0, strlen($values) - 3);
$build .= "\t\t\$this->setAttribute(Doctrine::ATTR_" . strtoupper($key) . ", " . $values . ");\n";
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment