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

35 lines
531 B
PHP
Raw Normal View History

<?php
namespace Doctrine\Tests\Mocks;
2009-01-04 19:15:32 +03:00
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)
2008-09-07 17:48:40 +04:00
{
return $this->_sequenceNumber++;
}
/* Mock API */
/**
* @return void
*/
public function reset()
{
$this->_sequenceNumber = 0;
}
}