Skip to content

Instantly share code, notes, and snippets.

@mamor
Created March 11, 2013 03:54
Show Gist options
  • Save mamor/5131797 to your computer and use it in GitHub Desktop.
Save mamor/5131797 to your computer and use it in GitHub Desktop.
Doctrineのカスタムタイプ例(point型の場合)
<?php
namespace Doctrine\DBAL\Types;
use Doctrine\DBAL\Platforms\AbstractPlatform;
class PointType extends Type
{
public function getName() {
return 'point';
}
public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform) {
}
}
//以下を何処かに書く
\Doctrine\DBAL\Types\Type::addType('point', '\Doctrine\DBAL\Types\PointType');
$conn->getDatabasePlatform()->registerDoctrineTypeMapping('point', 'point');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment