Merge branch 'notes-2.x' of https://git.mcnd.ca/mcndave/ulmus into notes-2.x

This commit is contained in:
Dave Mc Nicoll 2024-11-11 20:42:51 +00:00
commit 079a3fd110
1 changed files with 5 additions and 0 deletions

View File

@ -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();