. */ namespace SP\Domain\Common\Ports; use Closure; use Exception; use SP\Domain\Common\Services\ServiceException; use SP\Infrastructure\Database\QueryResult; /** * Interface Repository */ interface Repository { /** * Bubbles a Closure in a database transaction * * @param Closure $closure * @param object $newThis * @throws ServiceException * @throws Exception */ public function transactionAware(Closure $closure, object $newThis): mixed; /** * Run a SQL select query to get any data from any table * * @param array $columns * @param string $from * @param string|null $where * @param array|null $bindValues * * @return QueryResult */ public function getAny( array $columns, string $from, ?string $where = null, ?array $bindValues = null ): QueryResult; }