Fix code style.

This commit is contained in:
David Molineus
2015-01-12 19:03:29 +01:00
parent 74c786c24b
commit 037c6c907d
77 changed files with 1068 additions and 398 deletions

View File

@@ -13,6 +13,11 @@ namespace Netzmacht\Contao\Leaflet\Mapper\Layer;
use Netzmacht\Contao\Leaflet\Mapper\AbstractTypeMapper;
/**
* Class AbstractLayerMapper is the base mapper for the layer model.
*
* @package Netzmacht\Contao\Leaflet\Mapper\Layer
*/
class AbstractLayerMapper extends AbstractTypeMapper
{
/**
@@ -22,6 +27,9 @@ class AbstractLayerMapper extends AbstractTypeMapper
*/
protected static $modelClass = 'Netzmacht\Contao\Leaflet\Model\LayerModel';
/**
* {@inheritdoc}
*/
protected function initialize()
{
parent::initialize();

View File

@@ -11,7 +11,6 @@
namespace Netzmacht\Contao\Leaflet\Mapper\Layer;
use Netzmacht\Contao\Leaflet\Mapper\DefinitionMapper;
use Netzmacht\Contao\Leaflet\Model\LayerModel;
use Netzmacht\LeafletPHP\Definition;
@@ -19,6 +18,11 @@ use Netzmacht\LeafletPHP\Definition\Group\LayerGroup;
use Netzmacht\LeafletPHP\Definition\Layer;
use Netzmacht\LeafletPHP\Definition\Type\LatLngBounds;
/**
* Class GroupLayerMapper maps the layer model to the group layer definition.
*
* @package Netzmacht\Contao\Leaflet\Mapper\Layer
*/
class GroupLayerMapper extends AbstractLayerMapper
{
/**
@@ -44,7 +48,7 @@ class GroupLayerMapper extends AbstractLayerMapper
return 'Netzmacht\LeafletPHP\Definition\Group\FeatureGroup';
}
return parent::getClassName($model, $mapper, $bounds); // TODO: Change the autogenerated stub
return parent::getClassName($model, $mapper, $bounds);
}
/**

View File

@@ -24,6 +24,11 @@ use Netzmacht\LeafletPHP\Definition\Type\LatLngBounds;
use Netzmacht\LeafletPHP\Definition\UI\Marker;
use Netzmacht\LeafletPHP\Plugins\Ajax\GeoJsonAjax;
/**
* Class MarkersLayerMapper maps the layer model to the markers definition.
*
* @package Netzmacht\Contao\Leaflet\Mapper\Layer
*/
class MarkersLayerMapper extends AbstractLayerMapper implements GeoJsonMapper
{
/**
@@ -81,11 +86,7 @@ class MarkersLayerMapper extends AbstractLayerMapper implements GeoJsonMapper
}
/**
* @param \Model $model
* @param DefinitionMapper $mapper
* @param LatLngBounds $bounds
*
* @return mixed
* {@inheritdoc}
*/
public function handleGeoJson(\Model $model, DefinitionMapper $mapper, LatLngBounds $bounds = null)
{
@@ -106,18 +107,14 @@ class MarkersLayerMapper extends AbstractLayerMapper implements GeoJsonMapper
}
/**
* @param \Model $model
* Load all layer markers.
*
* @param \Model $model The layer model.
*
* @return \Model\Collection|null
*/
protected function loadMarkerModels(\Model $model)
{
$collection = MarkerModel::findBy(
array('active=1', 'pid=?'),
array($model->id),
array('order' => 'sorting')
);
return $collection;
return MarkerModel::findActiveBy('pid', $model->id, array('order' => 'sorting'));
}
}

View File

@@ -15,6 +15,11 @@ use Netzmacht\Contao\Leaflet\Mapper\DefinitionMapper;
use Netzmacht\LeafletPHP\Definition;
use Netzmacht\LeafletPHP\Definition\Type\LatLngBounds;
/**
* Class ProviderLayerMapper maps the layer model to the tile provider definition.
*
* @package Netzmacht\Contao\Leaflet\Mapper\Layer
*/
class ProviderLayerMapper extends AbstractLayerMapper
{
/**

View File

@@ -16,7 +16,7 @@ use Netzmacht\Contao\Leaflet\Model\LayerModel;
use Netzmacht\LeafletPHP\Definition\Type\LatLngBounds;
/**
* Class ReferenceLayerMapper maps an reference layer to another
* Class ReferenceLayerMapper maps an reference layer to another layer.
*
* @package Netzmacht\Contao\Leaflet\Mapper\Layer
*/

View File

@@ -26,6 +26,11 @@ use Netzmacht\LeafletPHP\Definition\Type\LatLngBounds;
use Netzmacht\LeafletPHP\Definition\Vector;
use Netzmacht\LeafletPHP\Plugins\Ajax\GeoJsonAjax;
/**
* Class VectorsLayerMapper maps the layer model for the Vectors layer definition.
*
* @package Netzmacht\Contao\Leaflet\Mapper\Layer
*/
class VectorsLayerMapper extends AbstractLayerMapper implements GeoJsonMapper
{
/**
@@ -87,11 +92,7 @@ class VectorsLayerMapper extends AbstractLayerMapper implements GeoJsonMapper
}
/**
* @param \Model $model
* @param DefinitionMapper $mapper
* @param LatLngBounds $bounds
*
* @return mixed
* {@inheritdoc}
*/
public function handleGeoJson(\Model $model, DefinitionMapper $mapper, LatLngBounds $bounds = null)
{
@@ -114,19 +115,14 @@ class VectorsLayerMapper extends AbstractLayerMapper implements GeoJsonMapper
}
/**
* @param \Model $model
* Load vector models.
*
* @param \Model $model The layer model.
*
* @return \Model\Collection|null
*/
protected function loadVectorModels(\Model $model)
{
$collection = VectorModel::findBy(
array('active=1', 'pid=?'),
array($model->id),
array('order' => 'sorting')
);
return $collection;
return VectorModel::findActiveBy('pid', $model->id, array('order' => 'sorting'));
}
}