Cleanup
This commit is contained in:
@ -31,11 +31,23 @@ class BonoPie extends Ideal\Repository
|
||||
);
|
||||
return $model;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Define\Model $model
|
||||
* @param array $new_data
|
||||
* @return Define\Model
|
||||
* @throws Implement\Exception\EmptyResult
|
||||
*/
|
||||
public function edit(Define\Model $model, array $new_data): Define\Model
|
||||
{
|
||||
return $this->update($model, ['valor', 'pago'], $new_data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param float $value
|
||||
* @return array
|
||||
* @throws Implement\Exception\EmptyResult
|
||||
*/
|
||||
public function fetchByValue(float $value): array
|
||||
{
|
||||
$query = $this->connection->getQueryBuilder()
|
||||
@ -44,6 +56,12 @@ class BonoPie extends Ideal\Repository
|
||||
->where('valor = ?');
|
||||
return $this->fetchMany($query, [$value]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $pago_id
|
||||
* @return Model\Venta\BonoPie
|
||||
* @throws Implement\Exception\EmptyResult
|
||||
*/
|
||||
public function fetchByPago(int $pago_id): Model\Venta\BonoPie
|
||||
{
|
||||
$query = $this->connection->getQueryBuilder()
|
||||
@ -52,6 +70,12 @@ class BonoPie extends Ideal\Repository
|
||||
->where('pago = ?');
|
||||
return $this->fetchOne($query, [$pago_id]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $venta_id
|
||||
* @return Model\Venta\BonoPie
|
||||
* @throws Implement\Exception\EmptyResult
|
||||
*/
|
||||
public function fetchByVenta(int $venta_id): Model\Venta\BonoPie
|
||||
{
|
||||
$query = $this->connection->getQueryBuilder()
|
||||
|
Reference in New Issue
Block a user