public static function getAllRecords($options = [])
    {
        $options = Util::prepareOptions($options, [
            'indexField' => false,
            'order' => false,
            'limit' => false,
            'calcFoundRows' => false,
            'offset' => 0,
        ]);

        $query = 'SELECT '.($options['calcFoundRows'] ? 'SQL_CALC_FOUND_ROWS' : '').'* FROM `%s`';
        $params = [
            static::$tableName,
        ];

        if ($options['order']) {
            $query .= ' ORDER BY ' . join(',', static::_mapFieldOrder($options['order']));
        }

        if ($options['limit']) {
            $query .= sprintf(' LIMIT %u,%u', $options['offset'], $options['limit']);
        }

        if ($options['indexField']) {
            return DB::table(static::_cn($options['indexField']), $query, $params, null, [static::class,'handleError']);
        } else {
            return DB::allRecords($query, $params, [static::class,'handleError']);
        }
    }
public static function getAllRecords($options = [])
    {
        $options = Util::prepareOptions($options, [
            'indexField' => false,
            'order' => false,
            'limit' => false,
            'calcFoundRows' => false,
            'offset' => 0,
        ]);

        $query = 'SELECT '.($options['calcFoundRows'] ? 'SQL_CALC_FOUND_ROWS' : '').'* FROM `%s`';
        $params = [
            static::$tableName,
        ];

        if ($options['order']) {
            $query .= ' ORDER BY ' . join(',', static::_mapFieldOrder($options['order']));
        }

        if ($options['limit']) {
            $query .= sprintf(' LIMIT %u,%u', $options['offset'], $options['limit']);
        }

        if ($options['indexField']) {
            return DB::table(static::_cn($options['indexField']), $query, $params, null, [static::class,'handleError']);
        } else {
            return DB::allRecords($query, $params, [static::class,'handleError']);
        }
    }
public static function getAllRecords ( $ options = [ ] ) { $ options = Util :: prepareOptions ( $ options , [ 'indexField' => false , 'order' => false , 'limit' => false , 'calcFoundRows' => false , 'offset' => 0 , ] ) ; $ query = 'SELECT ' . ( $ options [ 'calcFoundRows' ] ? 'SQL_CALC_FOUND_ROWS' : '' ) . '* FROM `%s`' ; $ params = [ static :: $ tableName , ] ; if ( $ options [ 'order' ] ) { $ query .= ' ORDER BY ' . join ( ',' , static :: _mapFieldOrder ( $ options [ 'order' ] ) ) ; } if ( $ options [ 'limit' ] ) { $ query .= sprintf ( ' LIMIT %u,%u' , $ options [ 'offset' ] , $ options [ 'limit' ] ) ; } if ( $ options [ 'indexField' ] ) { return DB :: table ( static :: _cn ( $ options [ 'indexField' ] ) , $ query , $ params , null , [ static :: class , 'handleError' ] ) ; } else { return DB :: allRecords ( $ query , $ params , [ static :: class , 'handleError' ] ) ; } }
Attempts to get all database records for this class and returns them as is from the database.

@param array $options
@return array[]|null
Attempts to get all database records for this class and returns them as is from the database .