Define and Implement delete

This commit is contained in:
2022-09-09 13:15:27 -04:00
parent 9834eb70a4
commit 3811e8224b
4 changed files with 12 additions and 0 deletions

View File

@ -100,6 +100,12 @@ abstract class Repository implements RepositoryInterface
}
return $model;
}
public function delete(Model $model): void
{
$query = $this->getQueryBuilder()->delete($this->getTable())->where(['id = ?']);
$this->getConnection()->execute($query, [$model->getId()]);
}
public function fetchById(int $id): Model
{
$query = $this->getQueryBuilder()