Created
March 11, 2013 03:54
-
-
Save mamor/5131797 to your computer and use it in GitHub Desktop.
Doctrineのカスタムタイプ例(point型の場合)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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