Bolt\Legacy\Storage::compareSearchWeights PHP Метод

compareSearchWeights() приватный Метод

Or fallback to dates or title
private compareSearchWeights ( Content $a, Content $b ) : integer
$a Content
$b Content
Результат integer
    private function compareSearchWeights(Content $a, Content $b)
    {
        if ($a->getSearchResultWeight() > $b->getSearchResultWeight()) {
            return -1;
        }
        if ($a->getSearchResultWeight() < $b->getSearchResultWeight()) {
            return 1;
        }
        if ($a['datepublish'] > $b['datepublish']) {
            // later is more important
            return -1;
        }
        if ($a['datepublish'] < $b['datepublish']) {
            // earlier is less important
            return 1;
        }
        return strcasecmp($a['title'], $b['title']);
    }