Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 310 and 401] [Versions 311 and 401] [Versions 39 and 401] [Versions 400 and 401]

(no description)

File Size: 238 lines (6 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

IndexInfo:: (17 methods):
  __construct()
  __debugInfo()
  __toString()
  getKey()
  getName()
  getNamespace()
  getVersion()
  is2dSphere()
  isGeoHaystack()
  isSparse()
  isText()
  isTtl()
  isUnique()
  offsetExists()
  offsetGet()
  offsetSet()
  offsetUnset()


Class: IndexInfo  - X-Ref

Index information model class.

This class models the index information returned by the listIndexes command
or, for legacy servers, queries on the "system.indexes" collection. It
provides methods to access common index options, and allows access to other
options through the ArrayAccess interface (write methods are not supported).
For information on keys and index options, see the referenced
db.collection.createIndex() documentation.

__construct(array $info)   X-Ref

param: array $info Index info

__debugInfo()   X-Ref
Return the collection info as an array.

return: array

__toString()   X-Ref
Return the index name to allow casting IndexInfo to string.

return: string

getKey()   X-Ref
Return the index key.

return: array

getName()   X-Ref
Return the index name.

return: string

getNamespace()   X-Ref
Return the index namespace (e.g. "db.collection").

return: string

getVersion()   X-Ref
Return the index version.

return: integer

is2dSphere()   X-Ref
Return whether or not this index is of type 2dsphere.

return: boolean

isGeoHaystack()   X-Ref
Return whether or not this index is of type geoHaystack.

return: boolean

isSparse()   X-Ref
Return whether this is a sparse index.

return: boolean

isText()   X-Ref
Return whether or not this index is of type text.

return: boolean

isTtl()   X-Ref
Return whether this is a TTL index.

return: boolean

isUnique()   X-Ref
Return whether this is a unique index.

return: boolean

offsetExists($key)   X-Ref
Check whether a field exists in the index information.

param: mixed $key
return: boolean

offsetGet($key)   X-Ref
Return the field's value from the index information.

This method satisfies the Enumerating Indexes specification's requirement
that index fields be made accessible under their original names. It may
also be used to access fields that do not have a helper method.

param: mixed $key
return: mixed

offsetSet($key, $value)   X-Ref
Not supported.

param: mixed $key
param: mixed $value
return: void

offsetUnset($key)   X-Ref
Not supported.

param: mixed $key
return: void