2008-08-01 22:46:14 +04:00
|
|
|
<?php
|
|
|
|
|
2009-01-22 22:38:10 +03:00
|
|
|
namespace Doctrine\Tests\Mocks;
|
2009-01-04 19:15:32 +03:00
|
|
|
|
2012-12-14 22:55:28 +04:00
|
|
|
/**
|
|
|
|
* Mock class for DatabasePlatform.
|
|
|
|
*/
|
2009-01-22 22:38:10 +03:00
|
|
|
class DatabasePlatformMock extends \Doctrine\DBAL\Platforms\AbstractPlatform
|
2008-08-01 22:46:14 +04:00
|
|
|
{
|
2012-12-14 22:55:28 +04:00
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
2009-03-14 12:05:52 +03:00
|
|
|
private $_sequenceNextValSql = "";
|
2012-12-14 22:55:28 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @var bool
|
|
|
|
*/
|
2009-03-30 23:43:05 +04:00
|
|
|
private $_prefersIdentityColumns = true;
|
2012-12-14 22:55:28 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @var bool
|
|
|
|
*/
|
2009-03-30 23:43:05 +04:00
|
|
|
private $_prefersSequences = false;
|
2009-05-27 22:54:40 +04:00
|
|
|
|
2008-09-07 17:48:40 +04:00
|
|
|
/**
|
2012-12-14 22:55:28 +04:00
|
|
|
* {@inheritdoc}
|
2008-09-07 17:48:40 +04:00
|
|
|
*/
|
2009-02-18 10:59:11 +03:00
|
|
|
public function prefersIdentityColumns()
|
|
|
|
{
|
2008-09-07 17:48:40 +04:00
|
|
|
return $this->_prefersIdentityColumns;
|
|
|
|
}
|
2009-01-07 20:46:02 +03:00
|
|
|
|
2009-03-30 23:43:05 +04:00
|
|
|
/**
|
2012-12-14 22:55:28 +04:00
|
|
|
* {@inheritdoc}
|
2009-03-30 23:43:05 +04:00
|
|
|
*/
|
|
|
|
public function prefersSequences()
|
|
|
|
{
|
|
|
|
return $this->_prefersSequences;
|
|
|
|
}
|
|
|
|
|
2012-12-14 22:55:28 +04:00
|
|
|
/**
|
|
|
|
* {@inheritdoc}
|
|
|
|
*/
|
2010-03-05 19:35:00 +03:00
|
|
|
public function getSequenceNextValSQL($sequenceName)
|
2009-03-14 12:05:52 +03:00
|
|
|
{
|
|
|
|
return $this->_sequenceNextValSql;
|
|
|
|
}
|
|
|
|
|
2012-12-14 22:55:28 +04:00
|
|
|
/**
|
|
|
|
* {@inheritdoc}
|
|
|
|
*/
|
|
|
|
public function getBooleanTypeDeclarationSQL(array $field)
|
|
|
|
{
|
|
|
|
}
|
2009-09-05 06:44:45 +04:00
|
|
|
|
2012-12-14 22:55:28 +04:00
|
|
|
/**
|
|
|
|
* {@inheritdoc}
|
|
|
|
*/
|
|
|
|
public function getIntegerTypeDeclarationSQL(array $field)
|
|
|
|
{
|
|
|
|
}
|
2009-01-07 20:46:02 +03:00
|
|
|
|
2012-12-14 22:55:28 +04:00
|
|
|
/**
|
|
|
|
* {@inheritdoc}
|
|
|
|
*/
|
|
|
|
public function getBigIntTypeDeclarationSQL(array $field)
|
|
|
|
{
|
|
|
|
}
|
2009-01-07 20:46:02 +03:00
|
|
|
|
2012-12-14 22:55:28 +04:00
|
|
|
/**
|
|
|
|
* {@inheritdoc}
|
|
|
|
*/
|
|
|
|
public function getSmallIntTypeDeclarationSQL(array $field)
|
|
|
|
{
|
|
|
|
}
|
2009-01-07 20:46:02 +03:00
|
|
|
|
2012-12-14 22:55:28 +04:00
|
|
|
/**
|
|
|
|
* {@inheritdoc}
|
|
|
|
*/
|
|
|
|
protected function _getCommonIntegerTypeDeclarationSQL(array $columnDef)
|
|
|
|
{
|
|
|
|
}
|
2009-01-07 20:46:02 +03:00
|
|
|
|
2012-12-14 22:55:28 +04:00
|
|
|
/**
|
|
|
|
* {@inheritdoc}
|
|
|
|
*/
|
|
|
|
public function getVarcharTypeDeclarationSQL(array $field)
|
|
|
|
{
|
|
|
|
}
|
2011-11-12 15:56:44 +04:00
|
|
|
|
2012-12-14 22:55:28 +04:00
|
|
|
/**
|
|
|
|
* {@inheritdoc}
|
|
|
|
*/
|
|
|
|
public function getClobTypeDeclarationSQL(array $field)
|
|
|
|
{
|
|
|
|
}
|
2009-05-27 22:54:40 +04:00
|
|
|
|
2008-09-07 17:48:40 +04:00
|
|
|
/* MOCK API */
|
2009-05-27 22:54:40 +04:00
|
|
|
|
2012-12-14 22:55:28 +04:00
|
|
|
/**
|
|
|
|
* @param bool $bool
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
2008-09-07 17:48:40 +04:00
|
|
|
public function setPrefersIdentityColumns($bool)
|
|
|
|
{
|
2009-03-30 23:43:05 +04:00
|
|
|
$this->_prefersIdentityColumns = $bool;
|
|
|
|
}
|
|
|
|
|
2012-12-14 22:55:28 +04:00
|
|
|
/**
|
|
|
|
* @param bool $bool
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
2009-03-30 23:43:05 +04:00
|
|
|
public function setPrefersSequences($bool)
|
|
|
|
{
|
|
|
|
$this->_prefersSequences = $bool;
|
2008-09-07 17:48:40 +04:00
|
|
|
}
|
2009-03-14 12:05:52 +03:00
|
|
|
|
2012-12-14 22:55:28 +04:00
|
|
|
/**
|
|
|
|
* @param string $sql
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
2009-03-14 12:05:52 +03:00
|
|
|
public function setSequenceNextValSql($sql)
|
|
|
|
{
|
|
|
|
$this->_sequenceNextValSql = $sql;
|
|
|
|
}
|
2009-05-27 22:54:40 +04:00
|
|
|
|
2012-12-14 22:55:28 +04:00
|
|
|
/**
|
|
|
|
* {@inheritdoc}
|
|
|
|
*/
|
2009-05-27 22:54:40 +04:00
|
|
|
public function getName()
|
|
|
|
{
|
|
|
|
return 'mock';
|
|
|
|
}
|
2010-06-07 00:41:05 +04:00
|
|
|
|
2012-12-14 22:55:28 +04:00
|
|
|
/**
|
|
|
|
* {@inheritdoc}
|
|
|
|
*/
|
2010-06-07 00:41:05 +04:00
|
|
|
protected function initializeDoctrineTypeMappings()
|
|
|
|
{
|
2011-11-12 15:56:44 +04:00
|
|
|
}
|
2012-12-14 22:55:28 +04:00
|
|
|
|
2011-11-12 15:56:44 +04:00
|
|
|
/**
|
2012-12-14 22:55:28 +04:00
|
|
|
* {@inheritdoc}
|
2011-11-12 15:56:44 +04:00
|
|
|
*/
|
|
|
|
public function getBlobTypeDeclarationSQL(array $field)
|
|
|
|
{
|
|
|
|
throw DBALException::notSupported(__METHOD__);
|
2010-06-07 00:41:05 +04:00
|
|
|
}
|
2012-12-14 22:55:28 +04:00
|
|
|
}
|