Cleanup
This commit is contained in:
@ -3,13 +3,42 @@ namespace Incoviba\Common\Define;
|
||||
|
||||
use PDO;
|
||||
use PDOStatement;
|
||||
use PDOException;
|
||||
|
||||
interface Connection
|
||||
{
|
||||
/**
|
||||
* @return Connection
|
||||
* @throws PDOException
|
||||
*/
|
||||
public function connect(): Connection;
|
||||
|
||||
/**
|
||||
* @param string $query
|
||||
* @return PDOStatement
|
||||
* @throws PDOException
|
||||
*/
|
||||
public function query(string $query): PDOStatement;
|
||||
|
||||
/**
|
||||
* @param string $query
|
||||
* @return PDOStatement
|
||||
* @throws PDOException
|
||||
*/
|
||||
public function prepare(string $query): PDOStatement;
|
||||
|
||||
/**
|
||||
* @param string $query
|
||||
* @param array|null $data
|
||||
* @return PDOStatement
|
||||
* @throws PDOException
|
||||
*/
|
||||
public function execute(string $query, ?array $data = null): PDOStatement;
|
||||
|
||||
/**
|
||||
* @return PDO
|
||||
* @throws PDOException
|
||||
*/
|
||||
public function getPDO(): PDO;
|
||||
public function getQueryBuilder(): Query\Builder;
|
||||
}
|
||||
|
@ -2,8 +2,15 @@
|
||||
namespace Incoviba\Common\Define\Money;
|
||||
|
||||
use DateTimeInterface;
|
||||
use Incoviba\Common\Implement\Exception\EmptyResponse;
|
||||
|
||||
interface Provider
|
||||
{
|
||||
/**
|
||||
* @param string $money_symbol
|
||||
* @param DateTimeInterface $dateTime
|
||||
* @return float
|
||||
* @throws EmptyResponse
|
||||
*/
|
||||
public function get(string $money_symbol, DateTimeInterface $dateTime): float;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user