src/Utility/FileUpload.php
private function getOrderClause(string $field) : array
    {
        $className = App::shortName(get_class($this->table), 'Model/Table', 'Table');
        $config = (new ModuleConfig(ConfigType::FIELDS(), $className))->parse();

        if (! property_exists($config, $field)) {
            return [];
        }

        if (! property_exists($config->{$field}, 'orderBy')) {
            return [];
        }

        if (! property_exists($config->{$field}, 'orderDir')) {
            return [];
        }

        return [$config->{$field}->orderBy => $config->{$field}->orderDir];
    }
private function getOrderClause(string $field) : array
    {
        $className = App::shortName(get_class($this->table), 'Model/Table', 'Table');
        $config = (new ModuleConfig(ConfigType::FIELDS(), $className))->parse();

        if (! property_exists($config, $field)) {
            return [];
        }

        if (! property_exists($config->{$field}, 'orderBy')) {
            return [];
        }

        if (! property_exists($config->{$field}, 'orderDir')) {
            return [];
        }

        return [$config->{$field}->orderBy => $config->{$field}->orderDir];
    }
private function getOrderClause ( string $ field ) : array { $ className = App :: shortName ( get_class ( $ this -> table ) , 'Model/Table' , 'Table' ) ; $ config = ( new ModuleConfig ( ConfigType :: FIELDS ( ) , $ className ) ) -> parse ( ) ; if ( ! property_exists ( $ config , $ field ) ) { return [ ] ; } if ( ! property_exists ( $ config -> { $ field } , 'orderBy' ) ) { return [ ] ; } if ( ! property_exists ( $ config -> { $ field } , 'orderDir' ) ) { return [ ] ; } return [ $ config -> { $ field } -> orderBy => $ config -> { $ field } -> orderDir ] ; }
Adds order clause to the provided Query based on specified field configuration.

@see  https://github.com/QoboLtd/cakephp-utils/blob/v9.2.0/src/ModuleConfig/Parser/Schema/fields.json#L30-L40
@param string $field Field name
@return mixed[]
Adds order clause to the provided Query based on specified field configuration .