lib/Kumbia/ActiveRecord/BaseRecord.php 1 location
|
@@ 238-244 (lines=7) @@
|
| 235 |
|
* |
| 236 |
|
* @return bool |
| 237 |
|
*/ |
| 238 |
|
public static function exists($pk) |
| 239 |
|
{ |
| 240 |
|
$source = static::getSource(); |
| 241 |
|
$pkField = static::getPK(); |
| 242 |
|
|
| 243 |
|
return self::query("SELECT COUNT(*) AS count FROM $source WHERE $pkField = ?", $pk)->fetch()->count > 0; |
| 244 |
|
} |
| 245 |
|
|
| 246 |
|
/** |
| 247 |
|
* Paginar consulta sql. |
lib/Kumbia/ActiveRecord/LiteRecord.php 1 location
|
@@ 161-167 (lines=7) @@
|
| 158 |
|
* |
| 159 |
|
* @return bool |
| 160 |
|
*/ |
| 161 |
|
public static function delete($pk) |
| 162 |
|
{ |
| 163 |
|
$source = static::getSource(); |
| 164 |
|
$pkField = static::getPK(); |
| 165 |
|
|
| 166 |
|
return static::query("DELETE FROM $source WHERE $pkField = ?", (int) $pk)->rowCount() > 0; |
| 167 |
|
} |
| 168 |
|
|
| 169 |
|
/** |
| 170 |
|
* Buscar por clave primaria. |