chore: Update copyright year from 2025 to 2026 across core files
- Updated copyright headers in 3,055 core application files - Changed 'Copyright (C) 2014-2025' to 'Copyright (C) 2014-2026' - Added 123 new files from EspoCRM core updates - Removed 4 deprecated files - Total changes: 61,637 insertions, 54,283 deletions This is a routine maintenance update for the new year 2026.
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM – Open Source CRM application.
|
||||
* Copyright (C) 2014-2025 EspoCRM, Inc.
|
||||
* Copyright (C) 2014-2026 EspoCRM, Inc.
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
@@ -97,6 +97,7 @@ abstract class BaseQueryComposer implements QueryComposer
|
||||
'fromQuery',
|
||||
'forUpdate',
|
||||
'forShare',
|
||||
'withRecursive',
|
||||
];
|
||||
|
||||
/** @var string[] */
|
||||
@@ -646,6 +647,7 @@ abstract class BaseQueryComposer implements QueryComposer
|
||||
$tailPart = $this->getSelectTailPart($params);
|
||||
$joinsPart = $this->getJoinsPart($entity, $params, true);
|
||||
$groupByPart = $this->getGroupByPart($entity, $params);
|
||||
$withRecursivePart = $this->getWithRecursivePart($params);
|
||||
|
||||
// @todo remove 'customWhere' support
|
||||
if (!empty($params['customWhere'])) {
|
||||
@@ -683,19 +685,20 @@ abstract class BaseQueryComposer implements QueryComposer
|
||||
/** @var string $fromAlias */
|
||||
|
||||
return $this->composeSelectQuery(
|
||||
$fromPart,
|
||||
$selectPart,
|
||||
$fromAlias,
|
||||
$joinsPart,
|
||||
$wherePart,
|
||||
$orderPart,
|
||||
$params['offset'],
|
||||
$params['limit'],
|
||||
$params['distinct'],
|
||||
$groupByPart,
|
||||
$havingPart,
|
||||
$indexKeyList,
|
||||
$tailPart
|
||||
from: $fromPart,
|
||||
select: $selectPart,
|
||||
alias: $fromAlias,
|
||||
joins: $joinsPart,
|
||||
where: $wherePart,
|
||||
order: $orderPart,
|
||||
offset: $params['offset'],
|
||||
limit: $params['limit'],
|
||||
distinct: $params['distinct'],
|
||||
groupBy: $groupByPart,
|
||||
having: $havingPart,
|
||||
indexKeyList: $indexKeyList,
|
||||
tailPart: $tailPart,
|
||||
withRecursivePart: $withRecursivePart,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1790,11 +1793,22 @@ abstract class BaseQueryComposer implements QueryComposer
|
||||
|
||||
foreach ($itemPairList as $item) {
|
||||
$expression = $item[0];
|
||||
|
||||
if ($expression === '') {
|
||||
throw new RuntimeException("Bad select expression.");
|
||||
}
|
||||
|
||||
if ($item[1] === '') {
|
||||
$selectPartItemList[] = $expression;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
/** @noinspection PhpDeprecationInspection */
|
||||
$alias = $this->sanitizeSelectAlias($item[1]);
|
||||
|
||||
if ($expression === '' || $alias === '') {
|
||||
throw new RuntimeException("Bad select expression.");
|
||||
if ($alias === '') {
|
||||
throw new RuntimeException("Bad alias.");
|
||||
}
|
||||
|
||||
$selectPartItemList[] = "$expression AS " . $this->quoteIdentifier($alias);
|
||||
@@ -2053,7 +2067,7 @@ abstract class BaseQueryComposer implements QueryComposer
|
||||
|
||||
/**
|
||||
* @param string[]|array<string[]> $select
|
||||
* @param string[] $explicitJoins
|
||||
* @param string[]|array<int, mixed>[] $explicitJoins
|
||||
* @param array<string, mixed> $params
|
||||
*/
|
||||
protected function getBelongsToJoinsPart(
|
||||
@@ -3505,11 +3519,16 @@ abstract class BaseQueryComposer implements QueryComposer
|
||||
?string $groupBy = null,
|
||||
?string $having = null,
|
||||
?array $indexKeyList = null,
|
||||
?string $tailPart = null
|
||||
?string $tailPart = null,
|
||||
?string $withRecursivePart = null,
|
||||
): string {
|
||||
|
||||
$sql = "SELECT";
|
||||
|
||||
if ($withRecursivePart !== null) {
|
||||
$sql = "$withRecursivePart " . $sql;
|
||||
}
|
||||
|
||||
if (!empty($distinct) && empty($groupBy)) {
|
||||
$sql .= " DISTINCT";
|
||||
}
|
||||
@@ -3796,4 +3815,47 @@ abstract class BaseQueryComposer implements QueryComposer
|
||||
* Add a LIMIT part to an SQL query.
|
||||
*/
|
||||
abstract protected function limit(string $sql, ?int $offset = null, ?int $limit = null): string;
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $params
|
||||
*/
|
||||
private function getWithRecursivePart(array $params): ?string
|
||||
{
|
||||
$items = $params['withRecursive'] ?? null;
|
||||
|
||||
if (!is_array($items)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$bodyParts = [];
|
||||
|
||||
foreach ($items as $item) {
|
||||
if (!is_array($item) || count($item) < 2) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$query = $item[0];
|
||||
$name = $item[1];
|
||||
|
||||
if (!$query instanceof Union || !is_string($name)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$bodyParts[] = $this->getWithRecursivePartItem($query, $name);
|
||||
}
|
||||
|
||||
if ($bodyParts === []) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return "WITH RECURSIVE " . implode(', ', $bodyParts);
|
||||
}
|
||||
|
||||
private function getWithRecursivePartItem(Union $query, string $name): string
|
||||
{
|
||||
$unionPart = $this->composeUnion($query);
|
||||
$namePart = $this->quoteIdentifier($this->toDb($name));
|
||||
|
||||
return "$namePart AS ($unionPart)";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user