Find the maximum ordering within this parent

@return int
484009
protected function getMaxOrdering()
    {
        $table  = $this->getTable();
        $db     = $table->getDriver();

        $query = $this->getObject('lib:database.query.select')
            ->columns('MAX(ordering)')
            ->table($table->getName());

        $this->_buildQueryWhere($query);

        return (int) $db->select($query, Database::FETCH_FIELD);
    }
164814
protected function getMax()
	{
		if ( ! $this->locked) {
			//\Log::info('Should lock before changes');
		}

		$dql = "SELECT MAX(e.right) FROM {$this->className} e";
		$dql .= $this->getAdditionalCondition('WHERE');
		$query = $this->entityManager
				->createQuery($dql);
		$max = (int) $query->getSingleScalarResult();

		// Maybe array helper stores even bigger value.
		// In reality it won't happen because items are flushed on DQL run.
		$maxArrayHelper = $this->arrayHelper->getCurrentMax();
		$max = max($max, $maxArrayHelper);

		return $max;
	}
956031
public function getDepth()
    {
        return array_reduce(
            $this->cartLines->toArray(),
            function ($depth, CartLineInterface $cartLine) {
                return max($depth, $cartLine->getDepth());
            },
            0
        );
    }
731075
public function getMaximumLevels()
    {
        if ($this->maximumLevels === null) {
            $this->maximumLevels = $this->fusionValue('maximumLevels');
            if ($this->maximumLevels > self::MAXIMUM_LEVELS_LIMIT) {
                $this->maximumLevels = self::MAXIMUM_LEVELS_LIMIT;
            }
        }

        return $this->maximumLevels;
    }
1022660
private function sort()
    {
        if (!$this->sorted) {
            uasort(
                $this->items, function ($a, $b) {
                    $qA = $a->getQuality();
                    $qB = $b->getQuality();

                    if ($qA === $qB) {
                        return $a->getIndex() > $b->getIndex() ? 1 : -1;
                    }

                    return $qA > $qB ? -1 : 1;
                }
            );

            $this->sorted = true;
        }
    }
926935
public function orderByScoreDesc(): self
    {
        return $this->sortByDesc(function (Result $result) {
            return $result->getScore($this->maxCommits(), $this->maxComplexity());
        });
    }
730234
public function max(){
		
		if($this->isEmpty()){
			throw new \UnderflowException(\get_called_class() . ' is empty');
		}
		
		$max = $this->front();
		
		for($i = 1, $l = $this->count(); $i < $l; ++$i){
			if(Number::greaterThan($this->_Arr[$i], $max)){
				$max = $this->_Arr[$i];
			}
		}
		
		return $max;
		
	}
850760
private function get_min_max()
    {
        if ($this->page_count > $this->args['range']) {
            if ($this->current_page <= $this->args['range']) {
                return [
                    1,
                    $this->args['range'] + 1,
                ];
            }

            if ($this->current_page >= ($this->page_count - $this->args['ceil'])) {
                return [
                    $this->page_count - $this->args['range'],
                    $this->page_count,
                ];
            }

            if ($this->current_page >= $this->args['range']
                && $this->current_page < ($this->page_count - $this->args['ceil'])
            ) {
                 return [
                     $this->current_page - $this->args['ceil'],
                     $this->current_page + $this->args['ceil'],
                 ];
            }
        }

        return [1, $this->page_count];
    }
3102
public function getMaxDepth()
    {
        if (0 === func_num_args() || func_get_arg(0)) {
            @trigger_error(sprintf('%s is deprecated since version 2.1 and will be removed in 3.0. Use %s::isMaxDepthEnabled() instead.', __METHOD__, __CLASS__), E_USER_DEPRECATED);
        }

        return $this->maxDepth;
    }
1214180
protected function determineParentTariff()
    {
        if ($this->tariff === null) {
            if (!empty($this->parent_id)) {
                return $this->parent_id;
            }

            return null;
        }

        if ($this->tariff->parent_id !== null) {
            return $this->tariff->parent_id;
        }

        return $this->tariff->id;
    }
832204
public function getCurrentOrder()
    {
        $order = $this->_getData('blog_current_order');
        if ($order) {
            return $order;
        }

        $orders = $this->getAvailableOrders();
        $defaultOrder = $this->getOrderField();

        if (!isset($orders[$defaultOrder])) {
            $keys = array_keys($orders);
            $defaultOrder = $keys[0];
        }

        $order = $this->toolbarModel->getOrder();
        if (!$order || !isset($orders[$order])) {
            $order = $defaultOrder;
        }

        if ($order != $defaultOrder) {
            $this->memorizeParam('sort_order', $order);
        }

        $this->setData('blog_current_order', $order);

        return $order;
    }
1005955
public function getOrderCnt()
    {
        if ($this->_iOrderCnt === null) {
            $this->_iOrderCnt = 0;
            if ($user = $this->getUser()) {
                $this->_iOrderCnt = $user->getOrderCount();
            }
        }

        return $this->_iOrderCnt;
    }
828390
public function getBestTarget()
    {
        if ($this->hasParent() && ($this->target == '' || $this->target == '#')) {
            return $this->parent->getBestTarget();
        }
        
        return $this->target;
    }
1212789
private function getMaxPosition()
    {
        $fullTableName = $this->getResource()->getTable(self::CATEGORY_FILTER_CONFIG_TABLE);
        $categoryPositionSelect = $this->getConnection()->select()
            ->from($fullTableName, [])
            ->columns(['category_max_position' => new \Zend_Db_Expr('MAX(position)')])
            ->where($this->getConnection()->quoteInto('entity_id = ?', (int) $this->category->getId()));

        return (int) $this->getConnection()->fetchOne($categoryPositionSelect);
    }
967541
protected function _getMax()
    {
        $field = $this->_config['right'];
        $rightField = $this->_config['rightField'];
        $edge = $this->_scope($this->_table->find())
            ->select([$field])
            ->orderDesc($rightField)
            ->first();

        if (empty($edge->{$field})) {
            return 0;
        }

        return $edge->{$field};
    }
9565
public function getHighestGroupPage()
    {
        $max = 1;
        $path = $this->prefixWithNamespace('groupPage');
        $groupPages = $this->argumentsAccessor->get($path, []);
        foreach ($groupPages as $groups) {
            if (!is_array($groups)) continue;
            foreach ($groups as $groupItemPage) {
                if ($groupItemPage > $max) {
                    $max = $groupItemPage;
                }
            }
        }

        return $max;
    }
709848
public function getMostUsedVatPercent()
    {
        $aPrices = $this->getPriceInfo();
        if (count($aPrices) == 0) {
            return;
        }

        return max(array_keys($aPrices, max($aPrices)));
    }