Jira issue originally created by user mjh_ca:
\Doctrine\DBAL\Types\Type defines an abstract method getName() however the code example at http://www.doctrine-project.org/documentation/manual/2_0/en/basic-mapping#custom-mapping-types does not include a getName() function:
Fatal error: Class My\Doctrine\DBAL\Types\MyType contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Doctrine\DBAL\Types\Type::getName) in /www/app/lib/My/Doctrine/DBAL/Types/MyType.php
Suggest amending example to:
* My custom datatype.
class MyType extends Type
const MYTYPE = 'mytype'; // modify to match your type name
public function getSqlDeclaration(array $fieldDeclaration, AbstractPlatform $platform)
// return the SQL used to create your column type. To create a portable column type, use the $platform.
public function convertToPHPValue($value, AbstractPlatform $platform)
// This is executed when the value is read from the database. Make your conversions here, optionally using the $platform.
public function convertToDatabaseValue($value, AbstractPlatform $platform)
// This is executed when the value is written to the database. Make your conversions here, optionally using the $platform.
public function getName()
return self::MYTYPE; // modify to match your constant name
Comment created by @beberlei:
Issue was closed with resolution "Fixed"