88
86
* Parámetros que seran enlazados a la setencia SQL
93
90
public function bind($bind)
93
throw new KumbiaException('Los parámetros para enlazar a la sentencia SQL debe ser un array');
95
95
foreach ($bind as $k => $v) {
96
$this->_sql['bind'][":$k"] = $v;
96
$this->_sql['bind'][$k] = $v;
102
* Parámetro que sera enlazado a la setencia SQL
104
* @param string $bind
105
* @param string $value
108
public function bindValue($bind, $value)
110
$this->_sql['bind'][":$bind"] = $value;
115
101
* Retorna los elementos para ser enlazados
130
116
* @param string $table nombre de tabla
131
117
* @param string $conditions condiciones
132
118
* @return DbQuery
134
120
public function join($table, $conditions)
136
122
$this->_sql['join'][] = array('table' => $table, 'conditions' => $conditions);
143
129
* @param string $table nombre de tabla
144
130
* @param string $conditions condiciones
145
131
* @return DbQuery
147
133
public function leftJoin($table, $conditions)
149
135
$this->_sql['leftJoin'][] = array('table' => $table, 'conditions' => $conditions);
156
142
* @param string $table nombre de tabla
157
143
* @param string $conditions condiciones
158
144
* @return DbQuery
160
146
public function rightJoin($table, $conditions)
162
148
$this->_sql['rightJoin'][] = array('table' => $table, 'conditions' => $conditions);
169
155
* @param string $table nombre de tabla
170
156
* @param string $conditions condiciones
171
157
* @return DbQuery
173
159
public function fullJoin($table, $conditions)
175
161
$this->_sql['fullJoin'][] = array('table' => $table, 'conditions' => $conditions);
266
252
* @param string $columns columnas
267
253
* @return DbQuery
269
public function select($columns = NULL)
255
public function select($columns='*')
271
$this->_sql['command'] = 'select';
274
$this->columns($columns);
257
$this->_sql['select'] = $columns;
280
261
* Columnas a utilizar en el Query
282
* @param string $columns columnas
283
262
* @return DbQuery
285
264
public function columns($columns)
287
$this->_sql['columns'] = $columns;
266
$this->select($columns);
292
270
* Construye la consulta DELETE
294
272
* @return DbQuery
296
274
public function delete()
298
$this->_sql['command'] = 'delete';
303
* Construye la consulta UPDATE
305
* @param array $data claves/valores
308
public function update($data)
311
$this->_sql['data'] = $data;
312
$this->_sql['command'] = 'update';
317
* Construye la consulta UPDATE
319
* @param string | array $data columnas, o array de claves/valores
322
public function insert($data)
325
$this->_sql['data'] = $data;
326
$this->_sql['command'] = 'insert';
276
$this->_sql['delete'] = TRUE;
281
* Construye la consulta UPDATE
283
* @param string | array $values claves/valores
286
public function update($values)
288
$this->_sql['update'] = $values;
293
* Construye la consulta UPDATE
295
* @param string | array $columns columnas, o array de claves/valores
296
* @param string $values
299
public function insert($columns, $values=null)
301
$this->_sql['insert'] = array('columns' => $columns, 'values' => $values);