Se agregan fetchs
This commit is contained in:
@ -65,4 +65,18 @@ class Customer extends Ideal\Repository
|
||||
->where('rut = :rut');
|
||||
return $this->fetchOne($query, compact('rut'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $toku_id
|
||||
* @return Model\MediosPago\Toku\Customer
|
||||
* @throws Implement\Exception\EmptyResult
|
||||
*/
|
||||
public function fetchByTokuId(string $toku_id): Model\MediosPago\Toku\Customer
|
||||
{
|
||||
$query = $this->connection->getQueryBuilder()
|
||||
->select()
|
||||
->from($this->getTable())
|
||||
->where('toku_id = :toku_id');
|
||||
return $this->fetchOne($query, compact('toku_id'));
|
||||
}
|
||||
}
|
||||
|
@ -42,6 +42,11 @@ class Invoice extends Ideal\Repository
|
||||
return $this->update($model, ['cuota_id', 'toku_id', 'updated_at'], array_merge($new_data, ['updated_at' => (new DateTimeImmutable())->format('Y-m-d H:i:s.u')]));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $cuota_id
|
||||
* @return Model\MediosPago\Toku\Invoice
|
||||
* @throws Implement\Exception\EmptyResult
|
||||
*/
|
||||
public function fetchByCuota(int $cuota_id): Model\MediosPago\Toku\Invoice
|
||||
{
|
||||
$query = $this->connection->getQueryBuilder()
|
||||
@ -50,4 +55,18 @@ class Invoice extends Ideal\Repository
|
||||
->where('cuota_id = :cuota_id');
|
||||
return $this->fetchOne($query, compact('cuota_id'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $toku_id
|
||||
* @return Model\MediosPago\Toku\Invoice
|
||||
* @throws Implement\Exception\EmptyResult
|
||||
*/
|
||||
public function fetchByTokuId(string $toku_id): Model\MediosPago\Toku\Invoice
|
||||
{
|
||||
$query = $this->connection->getQueryBuilder()
|
||||
->select()
|
||||
->from($this->getTable())
|
||||
->where('toku_id = :toku_id');
|
||||
return $this->fetchOne($query, compact('toku_id'));
|
||||
}
|
||||
}
|
||||
|
@ -51,4 +51,12 @@ class Subscription extends Ideal\Repository
|
||||
->where('venta_id = :venta_id');
|
||||
return $this->fetchOne($query, compact('venta_id'));
|
||||
}
|
||||
public function fetchByTokuId(string $toku_id): Model\MediosPago\Toku\Subscription
|
||||
{
|
||||
$query = $this->connection->getQueryBuilder()
|
||||
->select()
|
||||
->from($this->getTable())
|
||||
->where('toku_id = :toku_id');
|
||||
return $this->fetchOne($query, compact('toku_id'));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user