Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace My\Project\Types;
- use Doctrine\DBAL\Types\Type;
- use Doctrine\DBAL\Platforms\AbstractPlatform;
- /**
- * My custom datatype.
- */
- class MyType extends Type
- {
- 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)
- {
- // This is executed when the value is read from the database. Make your conversions here.
- }
- 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.
- }
- }
Add Comment
Please, Sign In to add comment