diff --git a/application/Espo/Core/Utils/Database/DBAL/FieldTypes/Bool.php b/application/Espo/Core/Utils/Database/DBAL/FieldTypes/Bool.php index 58fde57ec4..c6dce4d685 100644 --- a/application/Espo/Core/Utils/Database/DBAL/FieldTypes/Bool.php +++ b/application/Espo/Core/Utils/Database/DBAL/FieldTypes/Bool.php @@ -18,15 +18,13 @@ * * You should have received a copy of the GNU General Public License * along with EspoCRM. If not, see http://www.gnu.org/licenses/. - ************************************************************************/ + ************************************************************************/ namespace Espo\Core\Utils\Database\DBAL\FieldTypes; -use Doctrine\DBAL\Types\Type; -use Doctrine\DBAL\Platforms\AbstractPlatform; +use Doctrine\DBAL\Types\BooleanType; - -class Bool extends Type +class Bool extends BooleanType { const BOOL = 'bool'; @@ -39,27 +37,4 @@ class Bool extends Type { return 'TINYINT'; } - - - public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform) - { - return $platform->getBooleanTypeDeclarationSQL($fieldDeclaration); - } - - - public function convertToDatabaseValue($value, AbstractPlatform $platform) - { - return $platform->convertBooleans($value); - } - - - public function convertToPHPValue($value, AbstractPlatform $platform) - { - return (null === $value) ? null : (bool) $value; - } - - public function getBindingType() - { - return \PDO::PARAM_BOOL; - } } \ No newline at end of file diff --git a/application/Espo/Core/Utils/Database/DBAL/FieldTypes/Int.php b/application/Espo/Core/Utils/Database/DBAL/FieldTypes/Int.php index cbadfc5f97..0c0c688af0 100644 --- a/application/Espo/Core/Utils/Database/DBAL/FieldTypes/Int.php +++ b/application/Espo/Core/Utils/Database/DBAL/FieldTypes/Int.php @@ -18,38 +18,18 @@ * * You should have received a copy of the GNU General Public License * along with EspoCRM. If not, see http://www.gnu.org/licenses/. - ************************************************************************/ + ************************************************************************/ namespace Espo\Core\Utils\Database\DBAL\FieldTypes; -use Doctrine\DBAL\Types\Type; -use Doctrine\DBAL\Platforms\AbstractPlatform; +use Doctrine\DBAL\Types\IntegerType; - -class Int extends Type +class Int extends IntegerType { const INTtype = 'int'; - public function getName() { return self::INTtype; } - - public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform) - { - return $platform->getIntegerTypeDeclarationSQL($fieldDeclaration); - } - - - public function convertToPHPValue($value, AbstractPlatform $platform) - { - return (null === $value) ? null : (int) $value; - } - - - public function getBindingType() - { - return \PDO::PARAM_INT; - } } \ No newline at end of file diff --git a/application/Espo/Core/Utils/Database/DBAL/FieldTypes/Password.php b/application/Espo/Core/Utils/Database/DBAL/FieldTypes/Password.php index b9a03c10ff..5d408dfec6 100644 --- a/application/Espo/Core/Utils/Database/DBAL/FieldTypes/Password.php +++ b/application/Espo/Core/Utils/Database/DBAL/FieldTypes/Password.php @@ -18,14 +18,13 @@ * * You should have received a copy of the GNU General Public License * along with EspoCRM. If not, see http://www.gnu.org/licenses/. - ************************************************************************/ + ************************************************************************/ namespace Espo\Core\Utils\Database\DBAL\FieldTypes; -use Doctrine\DBAL\Types\Type; -use Doctrine\DBAL\Platforms\AbstractPlatform; +use Doctrine\DBAL\Types\StringType; -class Password extends Type +class Password extends StringType { const PASSWORD = 'password'; @@ -38,23 +37,5 @@ class Password extends Type { return 'VARCHAR'; } - - public function getSqlDeclaration(array $fieldDeclaration, AbstractPlatform $platform) - { - return $platform->getVarcharTypeDeclarationSQL($fieldDeclaration); - //return "MD5"; - } - - /*public function convertToPHPValue($value, AbstractPlatform $platform) - { - return $value; - } - - public function convertToDatabaseValue($value, AbstractPlatform $platform) - { - return $value; - } */ - - } diff --git a/application/Espo/Core/Utils/Database/DBAL/FieldTypes/Varchar.php b/application/Espo/Core/Utils/Database/DBAL/FieldTypes/Varchar.php index 800aaf5402..77910cc1e3 100644 --- a/application/Espo/Core/Utils/Database/DBAL/FieldTypes/Varchar.php +++ b/application/Espo/Core/Utils/Database/DBAL/FieldTypes/Varchar.php @@ -18,15 +18,13 @@ * * You should have received a copy of the GNU General Public License * along with EspoCRM. If not, see http://www.gnu.org/licenses/. - ************************************************************************/ + ************************************************************************/ namespace Espo\Core\Utils\Database\DBAL\FieldTypes; -use Doctrine\DBAL\Types\Type; -use Doctrine\DBAL\Platforms\AbstractPlatform; +use Doctrine\DBAL\Types\StringType; - -class Varchar extends Type +class Varchar extends StringType { const VARCHAR = 'varchar'; @@ -34,16 +32,4 @@ class Varchar extends Type { return self::VARCHAR; } - - public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform) - { - return $platform->getVarcharTypeDeclarationSQL($fieldDeclaration); - //return 'varchar'; - } - - - public function getDefaultLength(AbstractPlatform $platform) - { - return $platform->getVarcharDefaultLength(); - } } \ No newline at end of file