Use getClassName instead of overwriting createInstance.
This commit is contained in:
1 parent
7520cbd55e
commit
16f8c41f6f
3 files changed
+11
-22
No files matched your search
@@ -53,18 +53,13 @@ class ProviderLayerMapper extends AbstractLayerMapper
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function createInstance(\Model $model, DefinitionMapper $mapper, LatLngBounds $bounds = null)
|
||||
protected function getClassName(\Model $model, DefinitionMapper $mapper, LatLngBounds $bounds = null)
|
||||
{
|
||||
if (isset($this->providers[$model->tile_provider]['class'])) {
|
||||
$class = $this->providers[$model->tile_provider]['class'];
|
||||
} else {
|
||||
$class = static::$definitionClass;
|
||||
return $this->providers[$model->tile_provider]['class'];
|
||||
}
|
||||
|
||||
$reflector = new \ReflectionClass($class);
|
||||
$instance = $reflector->newInstanceArgs($this->buildConstructArguments($model, $mapper, $bounds));
|
||||
|
||||
return $instance;
|
||||
return parent::getClassName($model, $mapper, $bounds);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user