public function disconnect() { if (($this->dbOptions & self::PERSISTENT) != 0) { return; } parent::disconnect(); }
public static function relayQuery(\Bitrix\Main\Data\Connection $connection, Query $query) { // prepare select $select = array(); foreach ($query->getSelectChains() as $selectChain) { $select[] = $selectChain->getLastElement()->getValue()->getName(); } // prepare filter $filter = array(); foreach ($query->getFilter() as $filterElem) { if (is_array($filterElem)) { $filter = array_merge($filter, $filterElem); } else { $filter[] = $filterElem; } } $result = $connection->getEntityByPrimary($query->getEntity(), $filter, $select); return $result; }