_tableAlias . '2Page'; $joinCondition = ["`{$block2Page}`.`idSideBlock` = `{$this->_tableAlias}`.`id`"]; if (null !== $pageIds) { $joinCondition["`{$block2Page}`.`idPage` " . (is_array($pageIds) ? 'IN(?)' : '= ?')] = $pageIds; } $all = $this->_db->quote(App_SideBlock_Obj::PAGE_ALL); $joinCondition[] = "`{$block2Page}`.`auto` = IF(`{$this->_tableAlias}`.`pageType` = {$all}, 'y', 'n')"; $select = $this->_db->select() ->from($this->_getPair(), $blockCols) ->join($this->_getPair($block2Page), Qs_Db::getWhereSql($joinCondition), $block2PageCols); return $select; } public static function getPages4Select() { $where = ['`Page`.`showSideBlock` = "y"']; return (array) App_Cms_Obj::getInstance()->getFilteredPages4Select(0, $where); } }