You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
<?php
namespace My\Project\Types;
use Doctrine\DBAL\Types\Type;
use Doctrine\DBAL\Platforms\AbstractPlatform;
/****
* 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
}
}
The text was updated successfully, but these errors were encountered:
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:
Suggest amending example to:
The text was updated successfully, but these errors were encountered: