Ejemplo n.º 1
0
 /**
  * Overrides DboSource::renderStatement to handle schema generation with SQLite3-style indexes
  *
  * @param string $type
  * @param array $data
  * @return string
  */
 public function renderStatement($type, $data)
 {
     switch (strtolower($type)) {
         case 'schema':
             extract($data);
             foreach (array('columns', 'indexes') as $var) {
                 if (is_array(${$var})) {
                     ${$var} = "\t" . join(",\n\t", array_filter(${$var}));
                 }
             }
             return "CREATE TABLE {$table} (\n{$columns});\n{$indexes}";
             break;
         default:
             return parent::renderStatement($type, $data);
             break;
     }
 }