diff --git a/src/Repository.php b/src/Repository.php index f8a8de9..ffe52b5 100644 --- a/src/Repository.php +++ b/src/Repository.php @@ -100,6 +100,11 @@ class Repository return Ulmus::runSelectQuery($this->queryBuilder, $this->adapter)->fetchColumn(0); } + public function exists(mixed $primaryKey) : bool + { + return $this->wherePrimaryKey($primaryKey)->count() !== 0; + } + public function deleteOne() { return $this->limit(1)->deleteSqlQuery()->runDeleteQuery();