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
|
@@ 265-271 (lines=7) @@
|
262 |
|
* |
263 |
|
* @return bool |
264 |
|
*/ |
265 |
|
public static function exists($pk) |
266 |
|
{ |
267 |
|
$source = static::getSource(); |
268 |
|
$pkField = static::getPK(); |
269 |
|
|
270 |
|
return self::query("SELECT COUNT(*) AS count FROM $source WHERE $pkField = ?", $pk)->fetch()->count > 0; |
271 |
|
} |
272 |
|
|
273 |
|
/** |
274 |
|
* Paginar consulta sql. |