public function getObject($key, string $keyField = null): ?FlexObjectInterface
    {
        return $this->getIndex(null, $keyField)->get($key);
    }
public function getObject($key, string $keyField = null): ?FlexObjectInterface
    {
        return $this->getIndex(null, $keyField)->get($key);
    }
public function getObject ( $ key , string $ keyField = null ) : ? FlexObjectInterface { return $ this -> getIndex ( null , $ keyField ) -> get ( $ key ) ; }
Returns an object if it exists.

Note: It is not safe to use the object without checking if the user can access it.

@param string $key
@param string|null $keyField  Field to be used as the key.
@return FlexObjectInterface|null
Returns an object if it exists .