public function byFunction(
        string $function,
        string $order
    ): SortBy {
        $this->sortsBy[] = [
            'type' => self::TYPE_FUNCTION,
            'function' => $function,
            'order' => $order,
        ];

        return $this;
    }
public function byFunction(
        string $function,
        string $order
    ): SortBy {
        $this->sortsBy[] = [
            'type' => self::TYPE_FUNCTION,
            'function' => $function,
            'order' => $order,
        ];

        return $this;
    }
public function byFunction ( string $ function , string $ order ) : SortBy { $ this -> sortsBy [ ] = [ 'type' => self :: TYPE_FUNCTION , 'function' => $ function , 'order' => $ order , ] ; return $ this ; }
Sort by function.

@param string $function
@param string $order

@return SortBy
Sort by function .