| 1 | <?php |
||
| 7 | abstract class SequenceRepository implements SequenceRepositoryInterface |
||
| 8 | { |
||
| 9 | const MAX_UNIQUE_LOOPS = 20; |
||
| 10 | |||
| 11 | /** @var \Doctrine\DBAL\Connection */ |
||
| 12 | private $_con; |
||
| 13 | |||
| 14 | /** @var \BWC\Share\Data\Sequence\SequenceGeneratorInterface */ |
||
| 15 | private $_generator; |
||
| 16 | |||
| 17 | |||
| 18 | |||
| 19 | function __construct(Connection $connection, SequenceGeneratorInterface $generator) { |
||
|
|
|||
| 20 | $this->_con = $connection; |
||
| 21 | $this->_generator = $generator; |
||
| 22 | } |
||
| 23 | |||
| 24 | |||
| 25 | |||
| 26 | abstract function getTableName(); |
||
| 27 | |||
| 28 | |||
| 29 | /** |
||
| 30 | * @param string $name |
||
| 31 | * @return string |
||
| 32 | */ |
||
| 33 | function generate($name = 'default') { |
||
| 45 | |||
| 46 | |||
| 47 | /** |
||
| 48 | * @param string $value |
||
| 49 | * @param string $name |
||
| 50 | * @return bool |
||
| 51 | */ |
||
| 52 | function exists($value, $name = 'default') { |
||
| 59 | |||
| 60 | } |
Adding explicit visibility (
private,protected, orpublic) is generally recommend to communicate to other developers how, and from where this method is intended to be used.