libSmalldb  v2.0.1
Public Member Functions | List of all members
ElementAttrIndex Class Reference

Public Member Functions

 __construct ($elementClassName=AbstractGraphElement\​class)
 ElementAttrIndex constructor. More...
 
 getElementById (string $id)
 
 createAttrIndex (string $key)
 
 hasAttrIndex (string $key)
 Returns true if the attribute is indexed. More...
 
 insertElement (AbstractGraphElement $element)
 Insert element into index (all keys has changed). More...
 
 removeElement (AbstractGraphElement $element)
 Remove element from index. More...
 
 update (string $key, $oldValue, $newValue, AbstractGraphElement $element)
 Update indices to match the changed attribute of the element. More...
 
 getAllElements ()
 Get all elements. More...
 
 getElements (string $key, $value)
 Get elements by the value of the attribute. More...
 

Constructor & Destructor Documentation

◆ __construct()

__construct (   $elementClassName = AbstractGraphElement\​class)

ElementAttrIndex constructor.

Member Function Documentation

◆ getElementById()

getElementById ( string  $id)

◆ createAttrIndex()

createAttrIndex ( string  $key)
Parameters
string$keyAttribute to index

◆ hasAttrIndex()

hasAttrIndex ( string  $key)

Returns true if the attribute is indexed.

◆ insertElement()

insertElement ( AbstractGraphElement  $element)

Insert element into index (all keys has changed).

◆ removeElement()

removeElement ( AbstractGraphElement  $element)

Remove element from index.

◆ update()

update ( string  $key,
  $oldValue,
  $newValue,
AbstractGraphElement  $element 
)

Update indices to match the changed attribute of the element.

◆ getAllElements()

getAllElements ( )

Get all elements.

Returns
AbstractGraphElement[]

◆ getElements()

getElements ( string  $key,
  $value 
)

Get elements by the value of the attribute.