orm alias max length prop

This commit is contained in:
Yuri Kuznetsov
2023-02-24 09:25:10 +02:00
parent 5bb0222abd
commit 2f03572df8
@@ -143,6 +143,8 @@ abstract class BaseQueryComposer implements QueryComposer
protected string $identifierQuoteCharacter = '`';
protected int $aliasMaxLength = 256;
protected bool $indexHints = true;
protected EntityFactory $entityFactory;
@@ -2908,8 +2910,8 @@ abstract class BaseQueryComposer implements QueryComposer
{
$string = preg_replace('/[^A-Za-z\r\n0-9_:\'" .,\-\(\)]+/', '', $string) ?? '';
if (strlen($string) > 256) {
$string = substr($string, 0, 256);
if (strlen($string) > $this->aliasMaxLength) {
$string = substr($string, 0, $this->aliasMaxLength);
}
return $string;