lib/Kumbia/ActiveRecord/BaseRecord.php 1 location
|
@@ 243-249 (lines=7) @@
|
240 |
|
* |
241 |
|
* @return bool |
242 |
|
*/ |
243 |
|
public static function exists($pk) |
244 |
|
{ |
245 |
|
$source = static::getSource(); |
246 |
|
$pkField = static::getPK(); |
247 |
|
|
248 |
|
return self::query("SELECT COUNT(*) AS count FROM $source WHERE $pkField = ?", $pk)->fetch()->count > 0; |
249 |
|
} |
250 |
|
|
251 |
|
/** |
252 |
|
* Paginar consulta sql. |
lib/Kumbia/ActiveRecord/LiteRecord.php 1 location
|
@@ 177-183 (lines=7) @@
|
174 |
|
* |
175 |
|
* @return bool |
176 |
|
*/ |
177 |
|
public static function delete($pk) |
178 |
|
{ |
179 |
|
$source = static::getSource(); |
180 |
|
$pkField = static::getPK(); |
181 |
|
|
182 |
|
return static::query("DELETE FROM $source WHERE $pkField = ?", (int) $pk)->rowCount() > 0; |
183 |
|
} |
184 |
|
|
185 |
|
/** |
186 |
|
* Buscar por clave primaria. |