added support for database expressions.

This commit is contained in:
Taylor Otwell
2011-10-12 19:55:44 -05:00
parent 76400967d9
commit 68455378cc
5 changed files with 123 additions and 21 deletions

View File

@@ -109,6 +109,13 @@ class Connection {
*/
public function query($sql, $bindings = array())
{
// First we need to remove all expressions from the bindings since
// they will be placed into the query as raw strings.
foreach ($bindings as $key => $value)
{
if ($value instanceof Expression) unset($bindings[$key]);
}
$sql = $this->transform($sql, $bindings);
$this->queries[] = compact('sql', 'bindings');