Skip to content

Commit

Permalink
Adding condition support using simple strings.
Browse files Browse the repository at this point in the history
  • Loading branch information
reines committed Mar 20, 2011
1 parent a5b4636 commit 66161f8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions dialect.php
Expand Up @@ -98,7 +98,7 @@ protected function update(UpdateQuery $query)
if (!empty($query->order))
$sql .= $this->order($query->order);

if ($limit > 0 || $offset > 0)
if ($query->limit > 0 || $query->offset > 0)
$sql .= $this->limit_offset($query->limit, $query->offset);

return $sql;
Expand All @@ -117,7 +117,7 @@ protected function delete(DeleteQuery $query)
if (!empty($query->order))
$sql .= $this->order($query->order);

if ($limit > 0 || $offset > 0)
if ($query->limit > 0 || $query->offset > 0)
$sql .= $this->limit_offset($query->limit, $query->offset);

return $sql;
Expand Down Expand Up @@ -178,7 +178,7 @@ protected function having($having)

protected function conditions($conditions)
{
return '(???)'; // TODO
return '('.$conditions.')';
}

protected function order($order)
Expand Down
10 changes: 5 additions & 5 deletions query.php
Expand Up @@ -50,8 +50,8 @@ public function __construct($fields, $table = null)
$this->group = array();
$this->order = array();
$this->joins = array();
$this->where = array();
$this->having = array();
$this->where = '';
$this->having = '';
$this->limit = 0;
$this->offset = 0;
}
Expand All @@ -68,7 +68,7 @@ public function __construct($type, $table)
$this->type = $type;
$this->table = $table;

$this->on = array();
$this->on = '';
}
}

Expand Down Expand Up @@ -114,7 +114,7 @@ public function __construct($values, $table)
$this->table = $table;

$this->order = array();
$this->where = array();
$this->where = '';
$this->limit = 0;
$this->offset = 0;
}
Expand All @@ -134,7 +134,7 @@ public function __construct($table)
$this->table = $table;

$this->order = array();
$this->where = array();
$this->where = '';
$this->limit = 0;
$this->offset = 0;
}
Expand Down

0 comments on commit 66161f8

Please sign in to comment.