Mas logging

This commit is contained in:
Juan Pablo Vial
2025-06-09 12:44:42 -04:00
parent f1ed9668fc
commit abb1ce7299
8 changed files with 140 additions and 30 deletions

View File

@ -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'));
}
}