Skip to content

@entering /tinyint.php secret
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
<?php
namespace EB\Core\KernelBundle\Doctrine\DBAL\Types;
use Doctrine\DBAL\Types\Type;
use Doctrine\DBAL\Platforms\AbstractPlatform;
/**
* Tinyint data type for Doctrine DBAL
*/
class TinyIntType extends Type
{
/**
* @const string
*/
const TINYINT = 'tinyint';
/**
* {@inheritDoc}
*/
public function getName()
{
return self::TINYINT;
}
/**
* {@inheritDoc}
*/
public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform)
{
return 'TINY' . $platform->getIntegerTypeDeclarationSQL($fieldDeclaration);
}
/**
* {@inheritDoc}
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function convertToPHPValue($value, AbstractPlatform $platform)
{
return (null === $value) ? null : (int) $value;
}
/**
* {@inheritDoc}
*/
public function getBindingType()
{
return \PDO::PARAM_INT;
}
/**
* {@inheritDoc}
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function requiresSQLCommentHint(AbstractPlatform $platform)
{
return true;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.