20 if (is_array($this->cfg->clauses))
21 $this->clauses = $this->cfg->clauses;
23 $this->clauses = array($this->cfg->clauses);
32 return $this->cfg->db;
39 $this->clauses = array();
68 public function add($prm) {
75 $this->clauses[] = $prm;
89 foreach($this->clauses as $c) {
92 $where[] = $tmp[
'where'];
93 $bind = array_merge($bind, $tmp[
'bind']);
96 }
else if (is_array($c)) {
97 $where[] = $this->
getDb()->quoteIdentifier($c[
'field']).
' '.$c[
'op'].
' ?';
98 $bind[] = is_array($c[
'val']) ?
'('.implode(
',', $c[
'val']).
')' : $this->
getDb()->quoteValue($c[
'val']);
107 'where'=>
'('.implode(
') '.$this->cfg->op.
' (', $where).
')',
117 return count($this->clauses);
128 $tmp = explode(
'?', $prm[
'where'],
count($prm[
'bind'])+1);
129 array_splice($prm[
'bind'],
count($tmp));
132 while($tmp2 = array_shift($tmp)) {
133 $where.= $tmp2.array_shift($prm[
'bind']);
setClauses(array $clauses)
static initTab(array &$vars, array $init)