lib/Kumbia/ActiveRecord/LiteRecord.php 1 location
|
@@ 168-174 (lines=7) @@
|
| 165 |
|
* |
| 166 |
|
* @return bool |
| 167 |
|
*/ |
| 168 |
|
public static function delete($pk) |
| 169 |
|
{ |
| 170 |
|
$source = static::getSource(); |
| 171 |
|
$pkField = static::getPK(); |
| 172 |
|
|
| 173 |
|
return static::query("DELETE FROM $source WHERE $pkField = ?", (int) $pk)->rowCount() > 0; |
| 174 |
|
} |
| 175 |
|
|
| 176 |
|
/** |
| 177 |
|
* Buscar por clave primaria. |
lib/Kumbia/ActiveRecord/BaseRecord.php 1 location
|
@@ 267-273 (lines=7) @@
|
| 264 |
|
* |
| 265 |
|
* @return bool |
| 266 |
|
*/ |
| 267 |
|
public static function exists($pk) |
| 268 |
|
{ |
| 269 |
|
$source = static::getSource(); |
| 270 |
|
$pkField = static::getPK(); |
| 271 |
|
|
| 272 |
|
return self::query("SELECT COUNT(*) AS count FROM $source WHERE $pkField = ?", $pk)->fetch()->count > 0; |
| 273 |
|
} |
| 274 |
|
|
| 275 |
|
/** |
| 276 |
|
* Paginar consulta sql. |