orm: fix string with colom

This commit is contained in:
Yuri Kuznetsov
2023-05-24 12:16:15 +03:00
parent 821e346e7d
commit fcdcf78629
2 changed files with 13 additions and 1 deletions
@@ -1178,7 +1178,7 @@ abstract class BaseQueryComposer implements QueryComposer
$entityType = $entity->getEntityType();
if (strpos($attribute, ':')) {
if (strpos($attribute, ':') && !Util::isArgumentString($attribute)) {
/** @var int $delimiterPosition */
$delimiterPosition = strpos($attribute, ':');
$function = substr($attribute, 0, $delimiterPosition);
@@ -3146,4 +3146,16 @@ class MysqlQueryComposerTest extends \PHPUnit\Framework\TestCase
$this->query->composeSelect($query2)
);
}
public function testStringWithColon(): void
{
$query = SelectBuilder::create()
->select(["'2020-10-10 20:20:20'"])
->from('Post')
->build();
$sql = $this->query->composeSelect($query);
$this->assertIsString($sql);
}
}