- Added Exists method
This commit is contained in:
parent
411992c7a8
commit
35ceb97241
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue