Sort clause for sorting payments by ID.
The following example sorts payment by descending IDs, from greater to lower:
$query = new PaymentQuery();
$query->addSortClause(new Id(SortDirection::DESC));
$payments = $paymentService->findPayments($query);
Typically used to ensure that the payments order is deterministic.
Tags
Constants¶
                 SORT_ASC        ¶
SORT_ASC        ¶
    
        
        AbstractSortClause.php
                :
        16
                 
    
        |  |  | 
                 SORT_DESC        ¶
SORT_DESC        ¶
    
        
        AbstractSortClause.php
                :
        19
                 
    
        |  |  | 
Methods¶
                 __construct()
            ¶
__construct()
            ¶
    
        
        Id.php
                :
        30
                 
    
        Constructs a new SortClause on $sortTarget in direction $sortDirection.
|  |  | 
Parameters
| Name | Type | Default value | Description | 
|---|---|---|---|
| $sortDirection | string | Id::SORT_ASC | one of SortDirection::ASC or SortDirection::DESC | 
                 getDirection()
            ¶
getDirection()
            ¶
    
        
        AbstractSortClause.php
                :
        39
                 
    
        |  |  | 
Return values
string
                 getField()
            ¶
getField()
            ¶
    
        
        FieldValueSortClause.php
                :
        24
                 
    
        |  |  | 
Return values
string
                 setDirection()
            ¶
setDirection()
            ¶
    
        
        AbstractSortClause.php
                :
        47
                 
    
        |  |  | 
Parameters
| Name | Type | Default value | Description | 
|---|---|---|---|
| $direction | string | - | - |