Returns an element that is associated with the given key in the element map with the specified identifier and satisfies the filter condition (if specified).

If there are many such elements, the function returns the one that has been put in the element map the last.

If there are no complying elements, the function returns null.

Effectively, the function is the equivalent of the following call:

findElementsByKey (
  elementMapId, 
  key, 
  filterQuery
).last().toElement()
Parameters:

elementMapId

The element map identifier.

Note: When the element map with such an identifier does not exist, the generator raises an error.

key
The hash key
filterQuery
This parameter allows you to specify an additional condition on the satisfying elements.

When specified, this should be a boolean subquery created with BooleanQuery() function. The subquery will be processed against each initially selected element and should return true if the element may be returned by the function and false otherwise. The tested element is passed as the generator context element.

See Also:

findElementByKey(), prepareElementMap(), findElementsByKey(), BooleanQuery()