Co-authored-by: Juan Pablo Vial <jpvialb@incoviba.cl>
Reviewed-on: #45
This commit is contained in:
2025-10-04 11:40:52 -03:00
parent 6ddc48ec60
commit 742de657c5
815 changed files with 62089 additions and 3287 deletions

View File

@ -1,11 +1,42 @@
<?php
namespace Incoviba\Common\Define;
use Incoviba\Common\Implement\Exception\EmptyResult;
use PDOException;
interface Repository
{
/**
* @param array|null $data
* @return Model
*/
public function create(?array $data = null): Model;
/**
* @param Model $model
* @return Model
* @throws PDOException
*/
public function save(Model $model): Model;
/**
* @param array $data_row
* @return Model
*/
public function load(array $data_row): Model;
/**
* @param Model $model
* @param array $new_data
* @return Model
* @throws EmptyResult
*/
public function edit(Model $model, array $new_data): Model;
/**
* @param Model $model
* @return void
* @throws PDOException
*/
public function remove(Model $model): void;
}