Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Differences Between: [Versions 310 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.

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

offsetUnset($key)   X-Ref
Not supported.

param: mixed $key