Skip to content

Commit

Permalink
Merge pull request #21 from gpslab/requiresSQLCommentHint
Browse files Browse the repository at this point in the history
Requires SQL comment hint for DBAL types
  • Loading branch information
peter-gribanov committed Apr 15, 2020
2 parents e697f97 + b3cb29b commit 2f1abf5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Persistence/Doctrine/DBAL/Types/BaseType.php
Expand Up @@ -62,6 +62,14 @@ public function getName()
return array_pop($names);
}

/**
* @return bool
*/
public function requiresSQLCommentHint(AbstractPlatform $platform)
{
return true;
}

/**
* @return string
*/
Expand Down
10 changes: 10 additions & 0 deletions tests/Persistence/Doctrine/DBAL/Types/IntervalTypeTest.php
Expand Up @@ -223,4 +223,14 @@ private function getInterval($class, $interval)
{
return call_user_func([$class, 'fromString'], $interval);
}

/**
* @dataProvider getTypes
*
* @param BaseType $type
*/
public function testRequiresSQLCommentHint(BaseType $type)
{
$this->assertTrue($type->requiresSQLCommentHint($this->platform));
}
}

0 comments on commit 2f1abf5

Please sign in to comment.