Use getClassName instead of overwriting createInstance.

This commit is contained in:
David Molineus
2015-01-08 12:57:14 +01:00
parent 7520cbd55e
commit 16f8c41f6f
3 changed files with 11 additions and 22 deletions

View File

@@ -43,16 +43,13 @@ class VectorsLayerMapper extends AbstractLayerMapper implements GeoJsonMapper
/**
* {@inheritdoc}
*/
protected function createInstance(\Model $model, DefinitionMapper $mapper, LatLngBounds $bounds = null)
protected function getClassName(\Model $model, DefinitionMapper $mapper, LatLngBounds $bounds = null)
{
if ($model->deferred) {
$reflector = new \ReflectionClass('Netzmacht\LeafletPHP\Plugins\Ajax\GeoJsonAjax');
$instance = $reflector->newInstanceArgs($this->buildConstructArguments($model, $mapper, $bounds));
return $instance;
return 'Netzmacht\LeafletPHP\Plugins\Ajax\GeoJsonAjax';
}
return parent::createInstance($model, $mapper, $bounds);
return parent::getClassName($model, $mapper, $bounds);
}
/**