public static function create(array $properties, Direction $direction = null) : Sort
    {
        if ($direction === null) {
            $direction = Direction::$ASC;
        }
        $orders = [];
        foreach ($properties as $property) {
            $orders[] = new Order($direction, $property);
        }
        return new self($orders);
    }
public static function create(array $properties, Direction $direction = null) : Sort
    {
        if ($direction === null) {
            $direction = Direction::$ASC;
        }
        $orders = [];
        foreach ($properties as $property) {
            $orders[] = new Order($direction, $property);
        }
        return new self($orders);
    }
public static function create ( array $ properties , Direction $ direction = null ) : Sort { if ( $ direction === null ) { $ direction = Direction :: $ ASC ; } $ orders = [ ] ; foreach ( $ properties as $ property ) { $ orders [ ] = new Order ( $ direction , $ property ) ; } return new self ( $ orders ) ; }
Factory method to order by several properties with the same direction.

@param array $properties
@param Direction $direction
@return Sort
Factory method to order by several properties with the same direction .