private static function sortByAuthor($a, $b, $i = 0)
    {
        $first = $a;
        $second = $b;

        if (isset($a[$i])) {
            $first = $a[$i];
        }

        if (isset($b[$i])) {
            $second = $b[$i];
        }

        if ($first == $a && $second == $b && $first['name'] == $second['name']) {
            return 1;
        } elseif ($first['name'] == $second['name']) {
            return self::sortByAuthor($a, $b, $i + 1);
        } else {
            return ($first['name'] < $second['name']) ? -1 : 1;
        }
    }
private static function sortByAuthor($a, $b, $i = 0)
    {
        $first = $a;
        $second = $b;

        if (isset($a[$i])) {
            $first = $a[$i];
        }

        if (isset($b[$i])) {
            $second = $b[$i];
        }

        if ($first == $a && $second == $b && $first['name'] == $second['name']) {
            return 1;
        } elseif ($first['name'] == $second['name']) {
            return self::sortByAuthor($a, $b, $i + 1);
        } else {
            return ($first['name'] < $second['name']) ? -1 : 1;
        }
    }
private static function sortByAuthor ( $ a , $ b , $ i = 0 ) { $ first = $ a ; $ second = $ b ; if ( isset ( $ a [ $ i ] ) ) { $ first = $ a [ $ i ] ; } if ( isset ( $ b [ $ i ] ) ) { $ second = $ b [ $ i ] ; } if ( $ first == $ a && $ second == $ b && $ first [ 'name' ] == $ second [ 'name' ] ) { return 1 ; } elseif ( $ first [ 'name' ] == $ second [ 'name' ] ) { return self :: sortByAuthor ( $ a , $ b , $ i + 1 ) ; } else { return ( $ first [ 'name' ] < $ second [ 'name' ] ) ? - 1 : 1 ; } }
Custom user sorting function used inside `fetch` to recursively sort authors
by their names.

@param array $a
@param array $b
@param integer $i
@return integer
Custom user sorting function used inside fetch to recursively sort authors by their names .