1
0
mirror of synced 2024-12-15 07:36:03 +03:00
doctrine2/tests/Doctrine/Tests/Mocks/SequenceMock.php

35 lines
531 B
PHP

<?php
namespace Doctrine\Tests\Mocks;
use Doctrine\ORM\EntityManager;
/**
* Mock class for SequenceGenerator.
*/
class SequenceMock extends \Doctrine\ORM\Id\SequenceGenerator
{
/**
* @var int
*/
private $_sequenceNumber = 0;
/**
* {@inheritdoc}
*/
public function generate(EntityManager $em, $entity)
{
return $this->_sequenceNumber++;
}
/* Mock API */
/**
* @return void
*/
public function reset()
{
$this->_sequenceNumber = 0;
}
}