Mas logging
This commit is contained in:
@ -2,6 +2,8 @@
|
||||
namespace Incoviba\Repository\Venta\MediosPago\Toku;
|
||||
|
||||
use DateTimeImmutable;
|
||||
use PDO;
|
||||
use PDOException;
|
||||
use Incoviba\Common\Define;
|
||||
use Incoviba\Common\Ideal;
|
||||
use Incoviba\Common\Implement;
|
||||
@ -79,4 +81,32 @@ class Customer extends Ideal\Repository
|
||||
->where('toku_id = :toku_id');
|
||||
return $this->fetchOne($query, compact('toku_id'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
* @throws Implement\Exception\EmptyResult
|
||||
*/
|
||||
public function fetchAllTokuIds(): array
|
||||
{
|
||||
$query = $this->connection->getQueryBuilder()
|
||||
->select('toku_id')
|
||||
->from($this->getTable());
|
||||
try {
|
||||
$statement = $this->connection->query($query);
|
||||
} catch (PDOException $exception) {
|
||||
throw new Implement\Exception\EmptyResult($query, $exception);
|
||||
}
|
||||
if ($statement->rowCount() === 0) {
|
||||
throw new Implement\Exception\EmptyResult($query);
|
||||
}
|
||||
return $statement->fetchAll(PDO::FETCH_COLUMN);
|
||||
}
|
||||
public function removeByTokuId(string $toku_id): void
|
||||
{
|
||||
$query = $this->connection->getQueryBuilder()
|
||||
->delete()
|
||||
->from($this->getTable())
|
||||
->where('toku_id = :toku_id');
|
||||
$this->connection->execute($query, compact('toku_id'));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user