2018-07-18 11:35:27 -04:00
|
|
|
<?php declare(strict_types=1);
|
2018-01-04 10:42:36 -05:00
|
|
|
|
2018-02-14 16:42:39 -05:00
|
|
|
namespace App\Repository;
|
2018-01-04 10:42:36 -05:00
|
|
|
|
2022-03-03 11:15:12 -05:00
|
|
|
use App\Entity\{Lenses, PreviouslyOwnedLenses};
|
2018-01-04 10:42:36 -05:00
|
|
|
|
2022-09-30 10:48:14 -04:00
|
|
|
class LensesRepository extends AcquireRepository
|
2018-01-04 10:42:36 -05:00
|
|
|
{
|
2022-09-30 10:48:14 -04:00
|
|
|
public function deacquire(mixed $currentRecord): void
|
2022-03-03 10:53:48 -05:00
|
|
|
{
|
2022-03-03 11:15:12 -05:00
|
|
|
$currentRecord->setFormerlyOwned(TRUE)
|
|
|
|
->setReceived(TRUE);
|
2018-01-04 10:42:36 -05:00
|
|
|
|
2022-03-03 10:53:48 -05:00
|
|
|
$this->moveRecord($currentRecord, new PreviouslyOwnedLenses());
|
|
|
|
}
|
2018-01-04 10:42:36 -05:00
|
|
|
|
2022-09-30 10:48:14 -04:00
|
|
|
public function reacquire(mixed $currentRecord): void
|
2022-03-03 10:53:48 -05:00
|
|
|
{
|
2022-03-03 11:15:12 -05:00
|
|
|
$currentRecord->setFormerlyOwned(FALSE);
|
2018-01-04 10:42:36 -05:00
|
|
|
|
2022-03-03 10:53:48 -05:00
|
|
|
$this->moveRecord($currentRecord, new Lenses());
|
|
|
|
}
|
2018-01-04 10:42:36 -05:00
|
|
|
}
|