-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added option to check if record exists within certain period
- Loading branch information
Showing
4 changed files
with
80 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php declare(strict_types=1); | ||
|
||
/** | ||
* @copyright Martin Procházka (c) 2022 | ||
* @license MIT License | ||
*/ | ||
|
||
namespace JuniWalk\Nestor\Entity; | ||
|
||
use Doctrine\ORM\EntityManagerInterface as EntityManager; | ||
use JuniWalk\Nestor\Exceptions\RecordNotValidException; | ||
use JuniWalk\Utils\Exceptions\EntityNotFoundException; | ||
use JuniWalk\Utils\ORM\AbstractRepository; | ||
|
||
abstract class RecordRepository extends AbstractRepository | ||
{ | ||
/** | ||
* @throws RecordNotValidException | ||
* @throws EntityNotFoundException | ||
*/ | ||
final public function __construct(EntityManager $entityManager) | ||
{ | ||
parent::__construct($entityManager); | ||
|
||
if (!is_subclass_of($this->entityName, Record::class)) { | ||
throw new RecordNotValidException; | ||
} | ||
} | ||
} |