Menu

## HashIndex extends Index
in package

HashIndex.php : 14

Represents a hash index on a collection

##### Tags

author

  Lucas S. Vieira

### Table of Contents

#### Methods

__construct() : mixed
  HashIndex constructor.
__toString() : mixed
  String representation of index
getCollection() : Collection|null
  Returns the collection where index belong to
getCreateData() : array<string|int, mixed>
  Return data for create index on server
getFields() : array<string|int, mixed>
  Returns index fields
getId() : string
  Index Id
getName() : string
  Returns index name
getType() : string
  Returns index type
isDeduplicate() : bool
  Return the deduplicate parameter
isNew() : bool
  If the index is a new one
isSparse() : bool
  If the index is sparse
isUnique() : bool
  If index has 'unique' constraint
jsonSerialize() : mixed
setCollection() : void
  Set the collection where the index belongs to
toArray() : array<string|int, mixed>
  Returns a array representation of index

### Methods

#### __construct()

HashIndex.php : 42

HashIndex constructor.

`public __construct(array<string|int, mixed> $fields[, array<string|int, mixed> $attributes = [] ]) : mixed`

##### Parameters

$fields : array<string|int, mixed>

  An array of attribute names.

$attributes : array<string|int, mixed> = []

##### Tags

throws
  InvalidParameterException

#### __toString()

Index.php : 121

String representation of index

`public __toString() : mixed`

#### getCollection()

Index.php : 200

Returns the collection where index belong to

`public getCollection() : Collection|null`

##### Return values

Collection|null —

A collection object or null if the index was not set to an collection yet

#### getCreateData()

HashIndex.php : 64

Return data for create index on server

`public getCreateData() : array<string|int, mixed>`

##### Return values

array<string|int, mixed>

#### getFields()

Index.php : 190

Returns index fields

`public getFields() : array<string|int, mixed>`

##### Return values

array<string|int, mixed>

#### getId()

Index.php : 160

Index Id

`public getId() : string`

##### Return values

string

#### getName()

Index.php : 170

Returns index name

`public getName() : string`

##### Return values

string

#### getType()

Index.php : 180

Returns index type

`public getType() : string`

##### Return values

string

#### isDeduplicate()

HashIndex.php : 54

Return the deduplicate parameter

`public isDeduplicate() : bool`

##### Return values

bool

#### isNew()

Index.php : 130

If the index is a new one

`public isNew() : bool`

##### Tags

see
  EntityInterface::isNew()

##### Return values

bool —

True if is a new object. False otherwise.

#### isSparse()

Index.php : 150

If the index is sparse

`public isSparse() : bool`

##### Return values

bool

#### isUnique()

Index.php : 140

If index has 'unique' constraint

`public isUnique() : bool`

##### Return values

bool

#### jsonSerialize()

Index.php : 245
`public jsonSerialize() : mixed`

##### Tags

see
  JsonSerializable::jsonSerialize()

#### setCollection()

Index.php : 210

Set the collection where the index belongs to

`public setCollection(Collection $collection) : void`

##### Parameters

$collection : Collection

#### toArray()

HashIndex.php : 80

Returns a array representation of index

`public toArray() : array<string|int, mixed>`

##### Return values

array<string|int, mixed>

## Search results