refactoring query compiler.

This commit is contained in:
Taylor Otwell 2011-08-22 22:14:11 -05:00
parent 5ca2e2b7f9
commit 25c78b8c55
3 changed files with 3 additions and 3 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
gitflow/*

1
gitflow Submodule

@ -0,0 +1 @@
Subproject commit be5dabf88e98075b9bc936bfa7de0f54a21a0482

View File

@ -31,9 +31,7 @@ public function select(Query $query)
if ( ! is_null($query->$clause)) $sql[] = call_user_func(array($this, 'compile_'.$clause), $query->$clause);
}
foreach ($sql as $key => $value) { if (is_null($value) or (string) $value === '') unset($sql[$key]); }
return implode(' ', $sql);
return implode(' ', array_filter($sql, function($value) { return ! is_null($value) and (string) $value !== ''; }));
}
/**