|
@@ 5123-5135 (lines=13) @@
|
| 5120 |
|
/** |
| 5121 |
|
* @see QueryWriter::queryRecordCount |
| 5122 |
|
*/ |
| 5123 |
|
public function queryRecordCount( $type, $conditions = array(), $addSql = NULL, $bindings = array() ) |
| 5124 |
|
{ |
| 5125 |
|
$addSql = $this->glueSQLCondition( $addSql ); |
| 5126 |
|
|
| 5127 |
|
$table = $this->esc( $type ); |
| 5128 |
|
|
| 5129 |
|
$this->updateCache(); //check if cache chain has been broken |
| 5130 |
|
|
| 5131 |
|
$sql = $this->makeSQLFromConditions( $conditions, $bindings, $addSql ); |
| 5132 |
|
$sql = "SELECT COUNT(*) FROM {$table} {$sql} -- keep-cache"; |
| 5133 |
|
|
| 5134 |
|
return (int) $this->adapter->getCell( $sql, $bindings ); |
| 5135 |
|
} |
| 5136 |
|
|
| 5137 |
|
/** |
| 5138 |
|
* @see QueryWriter::queryRecordCountRelated |
|
@@ 5173-5183 (lines=11) @@
|
| 5170 |
|
/** |
| 5171 |
|
* @see QueryWriter::deleteRecord |
| 5172 |
|
*/ |
| 5173 |
|
public function deleteRecord( $type, $conditions = array(), $addSql = NULL, $bindings = array() ) |
| 5174 |
|
{ |
| 5175 |
|
$addSql = $this->glueSQLCondition( $addSql ); |
| 5176 |
|
|
| 5177 |
|
$table = $this->esc( $type ); |
| 5178 |
|
|
| 5179 |
|
$sql = $this->makeSQLFromConditions( $conditions, $bindings, $addSql ); |
| 5180 |
|
$sql = "DELETE FROM {$table} {$sql}"; |
| 5181 |
|
|
| 5182 |
|
$this->adapter->exec( $sql, $bindings ); |
| 5183 |
|
} |
| 5184 |
|
|
| 5185 |
|
/** |
| 5186 |
|
* @see QueryWriter::deleteRelations |