/** * @param $conds - instanceof CB_SqlCond (parentized condition generator) * @param $offset - SQL OFFSET * @param $limit - SQL LIMIT */ public static function newFromSqlCond(CB_SqlCond $conds, $offset = 0, $limit = CB_PAGING_ROWS) { $rp = new CB_RootPager($offset, $limit); $rp->conds = $conds->getCond(); $rp->sqlCond =& $conds; return $rp; }
/** * add new "complete" range to "complete" ranges list * @param $ranges "complete" ranges list (decoded infix, encoded polish) * @param $sqlCond will be added to $ranges only when no such queue already exists * @modifies $ranges */ static function addRange(array &$ranges, CB_SqlCond $sqlCond) { $encPolishQueue = $sqlCond->getEncodedQueue(false); $queueExists = false; foreach ($ranges as &$range) { if ($range->rpn_queue == $encPolishQueue) { $queueExists = true; break; } } if (!$queueExists) { $sqlCond->getCond(); // build $sqlCond->infix_tokens array $ranges[] = (object) array('infix_tokens' => $sqlCond->infix_tokens, 'rpn_queue' => $encPolishQueue); } }