public function andSort(Sort $sort = null) : Sort
    {
        if ($sort === null) {
            return $this;
        }
        $orders = $this->orders;
        foreach ($sort as $order) {
            $orders[] = $order;
        }
        return new Sort($orders);
    }
public function andSort(Sort $sort = null) : Sort
    {
        if ($sort === null) {
            return $this;
        }
        $orders = $this->orders;
        foreach ($sort as $order) {
            $orders[] = $order;
        }
        return new Sort($orders);
    }
public function andSort ( Sort $ sort = null ) : Sort { if ( $ sort === null ) { return $ this ; } $ orders = $ this -> orders ; foreach ( $ sort as $ order ) { $ orders [ ] = $ order ; } return new Sort ( $ orders ) ; }
Does not modifies the object itself,
will return a new instance instead.

@param Sort $sort
@return Sort
Does not modifies the object itself will return a new instance instead .