In AbstractDbMapper the ClassMethods hydrator can be instantiated in two places in initialize()
protected function initialize()
{
if ($this->isInitialized) {
return;
}
if (!$this->dbAdapter instanceof Adapter) {
throw new \Exception('No db adapter present');
}
if (!$this->hydrator instanceof HydratorInterface) {
$this->hydrator = new ClassMethods;
}
if (!is_object($this->entityPrototype)) {
throw new \Exception('No entity prototype set');
}
$this->isInitialized = true;
}
and in getHydrator()
public function getHydrator()
{
if (!$this->hydrator) {
$this->hydrator = new ClassMethods(false);
}
return $this->hydrator;
}
What's the reason behind having ClassMethods instantiated in initialize() with $underscoreSeparatedKeys = true(default) and having it in getHydrator() instantiated $underscoreSeparatedKeys = false?
In AbstractDbMapper the
ClassMethodshydrator can be instantiated in two places ininitialize()and in
getHydrator()What's the reason behind having
ClassMethodsinstantiated ininitialize()with$underscoreSeparatedKeys = true(default) and having it ingetHydrator()instantiated$underscoreSeparatedKeys = false?