Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

Differences Between: [Versions 400 and 401]

(no description)

File Size: 230 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.

return: boolean
param: mixed $key

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.

return: mixed
param: mixed $key

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

param: mixed $key
param: mixed $value

offsetUnset($key)   X-Ref
Not supported.

param: mixed $key