The documentation for defining a custom dictionary is pretty light:
https://github.com/KnpLabs/DictionaryBundle#dictionary
I've created a class that implements Dictionary, and I've set getKeys() and getValues() to return arrays with keys and values, but I'm not sure what I'm supposed to do with offsetGet().
This works, but doesn't feel right:
public function offsetGet(mixed $offset): mixed
{
return array_combine($this->getKeys(), $this->getValues())[$offset];
}
Is there an example you can point me to? Thx.
The documentation for defining a custom dictionary is pretty light:
https://github.com/KnpLabs/DictionaryBundle#dictionary
I've created a class that implements Dictionary, and I've set getKeys() and getValues() to return arrays with keys and values, but I'm not sure what I'm supposed to do with offsetGet().
This works, but doesn't feel right:
Is there an example you can point me to? Thx.