Rajout de doctrine/orm
[zf2.biz/application_blanche.git] / vendor / doctrine / orm / tests / Doctrine / Tests / DbalTypes / UpperCaseStringType.php
diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/DbalTypes/UpperCaseStringType.php b/vendor/doctrine/orm/tests/Doctrine/Tests/DbalTypes/UpperCaseStringType.php
new file mode 100644 (file)
index 0000000..47e8c79
--- /dev/null
@@ -0,0 +1,29 @@
+<?php
+
+namespace Doctrine\Tests\DbalTypes;
+
+use Doctrine\DBAL\Types\StringType;
+use Doctrine\DBAL\Platforms\AbstractPlatform;
+
+class UpperCaseStringType extends StringType
+{
+    public function getName()
+    {
+        return 'upper_case_string';
+    }
+
+    public function canRequireSQLConversion()
+    {
+        return true;
+    }
+
+    public function convertToDatabaseValueSQL($sqlExpr, AbstractPlatform $platform)
+    {
+        return 'UPPER(' . $sqlExpr . ')';
+    }
+
+    public function convertToPHPValueSQL($sqlExpr, $platform)
+    {
+        return 'LOWER(' . $sqlExpr . ')';
+    }
+}