Run composer require checker and solve issues.

This commit is contained in:
David Molineus
2018-08-23 14:35:25 +02:00
parent e73a4d4bdf
commit 3d45f6b2eb
29 changed files with 98 additions and 50 deletions

View File

@@ -0,0 +1,11 @@
{
"symbol-whitelist": [
"null", "true", "false",
"static", "self", "parent",
"array", "string", "int", "float", "bool", "iterable", "callable", "void", "object",
"array_insert",
"Contao\\ManagerPlugin\\Bundle\\BundlePluginInterface",
"Contao\\ManagerPlugin\\Bundle\\Config\\BundleConfig",
"Contao\\ManagerPlugin\\Bundle\\Parser\\ParserInterface"
]
}

View File

@@ -2,7 +2,14 @@
Changelog Changelog
========= =========
3.0.1 (2018-xx-xx) 3.0.2 (2018-08-23)
------------------
[Full Changelog](https://github.com/netzmacht/contao-leaflet-maps/compare/3.0.1...3.0.2)
- Run composer require checker and solve issues.
3.0.1 (2018-06-20)
------------------ ------------------
[Full Changelog](https://github.com/netzmacht/contao-leaflet-maps/compare/3.0.0...3.0.1) [Full Changelog](https://github.com/netzmacht/contao-leaflet-maps/compare/3.0.0...3.0.1)

View File

@@ -23,7 +23,17 @@
}, },
"require": { "require": {
"php": ">=7.0", "php": ">=7.0",
"ext-json": "*",
"ext-pdo": "*",
"contao/core-bundle": "~4.4", "contao/core-bundle": "~4.4",
"doctrine/dbal": "^2.5",
"symfony/config": "~3.3 || ~4.0",
"symfony/event-dispatcher": "~3.3 || ~4.0",
"symfony/dependency-injection": "~3.3 || ~4.0",
"symfony/filesystem": "~3.3 || ~4.0",
"symfony/http-kernel": "~3.3 || ~4.0",
"symfony/translation": "~3.3 || ~4.0",
"symfony/templating": "~3.3 || ~4.0",
"netzmacht/contao-leaflet-libraries": "^1.0", "netzmacht/contao-leaflet-libraries": "^1.0",
"netzmacht/contao-leaflet-geocode-widget": "^1.2", "netzmacht/contao-leaflet-geocode-widget": "^1.2",
"netzmacht/php-javascript-builder": "^1.0", "netzmacht/php-javascript-builder": "^1.0",

View File

@@ -12,6 +12,8 @@
namespace Netzmacht\Contao\Leaflet\Backend; namespace Netzmacht\Contao\Leaflet\Backend;
use Contao\BackendTemplate;
/** /**
* Credits backend module. * Credits backend module.
* *
@@ -26,7 +28,7 @@ class About
*/ */
public function generate() public function generate()
{ {
$template = new \BackendTemplate('be_leaflet_about'); $template = new BackendTemplate('be_leaflet_about');
$template->headline = 'Leaftlet maps integration for Contao CMS'; $template->headline = 'Leaftlet maps integration for Contao CMS';
$template->libraries = $this->getLibraries(); $template->libraries = $this->getLibraries();
@@ -57,9 +59,8 @@ class About
if ($library['homepage']) { if ($library['homepage']) {
$library['homepage'] = sprintf( $library['homepage'] = sprintf(
'<a href="%s" %s>%s</a>', '<a href="%s" target="_blank">%s</a>',
$library['homepage'], $library['homepage'],
LINK_NEW_WINDOW,
preg_replace('#^(https?://(www)?)#i', '', $library['homepage']) preg_replace('#^(https?://(www)?)#i', '', $library['homepage'])
); );
} }

View File

@@ -21,7 +21,7 @@
</p> </p>
</div> </div>
<div class="right"> <div class="right">
<a href="http://www.netzmacht.de" <?php echo LINK_NEW_WINDOW; ?>> <a href="http://www.netzmacht.de" target="_blank">
<img src="bundles/netzmachtcontaoleaflet/img/logo.png"></a> <img src="bundles/netzmachtcontaoleaflet/img/logo.png"></a>
<p> <p>
<strong class="company">netzmacht </strong><br> <strong class="company">netzmacht </strong><br>

View File

@@ -36,7 +36,7 @@ class BuildDefinitionEvent extends Event
/** /**
* The model. * The model.
* *
* @var \Model * @var Model
*/ */
private $model; private $model;
@@ -74,7 +74,7 @@ class BuildDefinitionEvent extends Event
/** /**
* Get the model. * Get the model.
* *
* @return \Model * @return Model
*/ */
public function getModel() public function getModel()
{ {

View File

@@ -18,6 +18,7 @@ use Contao\Database\Result;
use Contao\Input; use Contao\Input;
use Contao\Model; use Contao\Model;
use Contao\Model\Collection; use Contao\Model\Collection;
use Contao\StringUtil;
use Netzmacht\Contao\Leaflet\MapProvider; use Netzmacht\Contao\Leaflet\MapProvider;
use Netzmacht\Contao\Leaflet\Model\MapModel; use Netzmacht\Contao\Leaflet\Model\MapModel;
use Netzmacht\Contao\Toolkit\Component\Hybrid\AbstractHybrid; use Netzmacht\Contao\Toolkit\Component\Hybrid\AbstractHybrid;
@@ -127,8 +128,8 @@ abstract class AbstractMapHybrid extends AbstractHybrid
$data['mapId'] = $mapId; $data['mapId'] = $mapId;
$style = ''; $style = '';
$height = deserialize($this->get('leaflet_height'), true); $height = StringUtil::deserialize($this->get('leaflet_height'), true);
$width = deserialize($this->get('leaflet_width'), true); $width = StringUtil::deserialize($this->get('leaflet_width'), true);
if (!empty($width['value'])) { if (!empty($width['value'])) {
$style .= 'width:' . $width['value'] . $width['unit'] . ';'; $style .= 'width:' . $width['value'] . $width['unit'] . ';';

View File

@@ -12,6 +12,8 @@
namespace Netzmacht\Contao\Leaflet\Frontend; namespace Netzmacht\Contao\Leaflet\Frontend;
use Contao\Config;
use Contao\Frontend;
use Netzmacht\Contao\Leaflet\Filter\Filter; use Netzmacht\Contao\Leaflet\Filter\Filter;
use Netzmacht\Contao\Leaflet\Mapper\Request; use Netzmacht\Contao\Leaflet\Mapper\Request;
@@ -72,7 +74,7 @@ class RequestUrl implements \JsonSerializable
$query .= '&amp;f=' . $filter->getName() . '&amp;v=' . $filter->toRequest(); $query .= '&amp;f=' . $filter->getName() . '&amp;v=' . $filter->toRequest();
} }
$url = \Config::get('websitePath') . '/' . \Frontend::addToUrl($query, false); $url = Config::get('websitePath') . '/' . Frontend::addToUrl($query, false);
return new static($url, $hash, $request); return new static($url, $hash, $request);
} }

View File

@@ -517,9 +517,9 @@ class LayerDcaListener extends AbstractListener
{ {
return sprintf( return sprintf(
'<a href="%s" title="%s">%s</a> ', '<a href="%s" title="%s">%s</a> ',
\Backend::addToUrl($href . '&amp;id=' . $row['id']), Backend::addToUrl($href . '&amp;id=' . $row['id']),
$title, $title,
\Image::getHtml($icon, $label, $attributes) Image::getHtml($icon, $label, $attributes)
); );
} }
} }

View File

@@ -13,6 +13,7 @@
namespace Netzmacht\Contao\Leaflet\Listener\Dca; namespace Netzmacht\Contao\Leaflet\Listener\Dca;
use Contao\Controller; use Contao\Controller;
use Contao\StringUtil;
use Doctrine\DBAL\Connection; use Doctrine\DBAL\Connection;
use Netzmacht\Contao\Leaflet\Model\IconModel; use Netzmacht\Contao\Leaflet\Model\IconModel;
use Netzmacht\Contao\Leaflet\Model\PopupModel; use Netzmacht\Contao\Leaflet\Model\PopupModel;
@@ -113,7 +114,7 @@ class MarkerDcaListener
'altitude' => null, 'altitude' => null,
]; ];
$values = trimsplit(',', $value); $values = StringUtil::trimsplit(',', $value);
$keys = array_keys($combined); $keys = array_keys($combined);
$count = count($values); $count = count($values);

View File

@@ -13,6 +13,7 @@
namespace Netzmacht\Contao\Leaflet\Listener\Dca; namespace Netzmacht\Contao\Leaflet\Listener\Dca;
use Contao\DataContainer; use Contao\DataContainer;
use Contao\StringUtil;
use Netzmacht\Contao\Toolkit\Dca\Manager; use Netzmacht\Contao\Toolkit\Dca\Manager;
use Netzmacht\LeafletPHP\Value\LatLng; use Netzmacht\LeafletPHP\Value\LatLng;
use Symfony\Component\Translation\TranslatorInterface as Translator; use Symfony\Component\Translation\TranslatorInterface as Translator;
@@ -116,7 +117,7 @@ class Validator
*/ */
public function validateMultipleCoordinateSets($values, $dataContainer) public function validateMultipleCoordinateSets($values, $dataContainer)
{ {
$sets = deserialize($values, true); $sets = StringUtil::deserialize($values, true);
foreach ($sets as $lines) { foreach ($sets as $lines) {
$this->validateMultipleCoordinates($lines, $dataContainer); $this->validateMultipleCoordinates($lines, $dataContainer);
} }

View File

@@ -16,6 +16,7 @@ namespace Netzmacht\Contao\Leaflet\Listener;
use Contao\FilesModel; use Contao\FilesModel;
use Contao\Model; use Contao\Model;
use Contao\StringUtil;
use Netzmacht\Contao\Leaflet\Event\ConvertToGeoJsonEvent; use Netzmacht\Contao\Leaflet\Event\ConvertToGeoJsonEvent;
use Netzmacht\Contao\Leaflet\Model\LayerModel; use Netzmacht\Contao\Leaflet\Model\LayerModel;
use Netzmacht\Contao\Toolkit\Data\Model\RepositoryManager; use Netzmacht\Contao\Toolkit\Data\Model\RepositoryManager;
@@ -117,7 +118,7 @@ final class GeoJsonListener
public function enrichObjects(GeoJsonObject $feature, LeafletDefinition $definition, $model) public function enrichObjects(GeoJsonObject $feature, LeafletDefinition $definition, $model)
{ {
if (($definition instanceof Marker || $definition instanceof Vector) if (($definition instanceof Marker || $definition instanceof Vector)
&& $model instanceof \Model && $feature instanceof Feature) { && $model instanceof Model && $feature instanceof Feature) {
$this->setDataProperty($model, $feature); $this->setDataProperty($model, $feature);
$this->setBoundsInformation($model, $feature); $this->setBoundsInformation($model, $feature);
} }
@@ -148,7 +149,7 @@ final class GeoJsonListener
*/ */
public function setModelData(GeoJsonObject $feature, $model) public function setModelData(GeoJsonObject $feature, $model)
{ {
if (!$model instanceof \Model || !$feature instanceof Feature if (!$model instanceof Model || !$feature instanceof Feature
|| empty($this->featureModelProperties[$model->getTable()])) { || empty($this->featureModelProperties[$model->getTable()])) {
return; return;
} }
@@ -169,12 +170,12 @@ final class GeoJsonListener
/** /**
* Parse the model value based on the config. * Parse the model value based on the config.
* *
* @param \Model $model The model. * @param Model $model The model.
* @param mixed $property The property config. * @param mixed $property The property config.
* *
* @return array|mixed|null * @return array|mixed|null
*/ */
private function parseModelValue(\Model $model, &$property) private function parseModelValue(Model $model, &$property)
{ {
if (is_array($property)) { if (is_array($property)) {
list($property, $type) = $property; list($property, $type) = $property;
@@ -183,7 +184,7 @@ final class GeoJsonListener
switch ($type) { switch ($type) {
case 'array': case 'array':
case 'object': case 'object':
$value = deserialize($value, true); $value = StringUtil::deserialize($value, true);
break; break;
case 'file': case 'file':
@@ -194,7 +195,7 @@ final class GeoJsonListener
case 'files': case 'files':
$repository = $this->repositoryManager->getRepository(FilesModel::class); $repository = $this->repositoryManager->getRepository(FilesModel::class);
$collection = $repository->findMultipleByUuids(deserialize($value, true)); $collection = $repository->findMultipleByUuids(StringUtil::deserialize($value, true));
if ($collection) { if ($collection) {
$value = $collection->fetchEach('path'); $value = $collection->fetchEach('path');

View File

@@ -12,6 +12,7 @@
namespace Netzmacht\Contao\Leaflet\Listener; namespace Netzmacht\Contao\Leaflet\Listener;
use Contao\Model;
use Netzmacht\Contao\Leaflet\Event\GetHashEvent; use Netzmacht\Contao\Leaflet\Event\GetHashEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface;
@@ -46,7 +47,7 @@ class HashSubscriber implements EventSubscriberInterface
{ {
$data = $event->getData(); $data = $event->getData();
if ($data instanceof \Model) { if ($data instanceof Model) {
$event->setHash($data->getTable() . '::' . $data->{$data->getPk()}); $event->setHash($data->getTable() . '::' . $data->{$data->getPk()});
} }
} }

View File

@@ -14,6 +14,7 @@ declare(strict_types=1);
namespace Netzmacht\Contao\Leaflet\Listener; namespace Netzmacht\Contao\Leaflet\Listener;
use Contao\File;
use Netzmacht\Contao\Leaflet\Encoder\ContaoAssets; use Netzmacht\Contao\Leaflet\Encoder\ContaoAssets;
use Netzmacht\Contao\Leaflet\Frontend\Assets\LibrariesConfiguration; use Netzmacht\Contao\Leaflet\Frontend\Assets\LibrariesConfiguration;
use Netzmacht\Contao\Leaflet\Mapper\DefinitionMapper; use Netzmacht\Contao\Leaflet\Mapper\DefinitionMapper;
@@ -117,7 +118,7 @@ class LoadAssetsListener
// TODO: Cache it. // TODO: Cache it.
// codingStandardsIgnoreEnd // codingStandardsIgnoreEnd
$file = new \File('assets/leaflet/js/icons.js'); $file = new File('assets/leaflet/js/icons.js');
$file->write($buffer); $file->write($buffer);
$file->close(); $file->close();

View File

@@ -13,6 +13,7 @@
namespace Netzmacht\Contao\Leaflet\Mapper\Control; namespace Netzmacht\Contao\Leaflet\Mapper\Control;
use Contao\Model; use Contao\Model;
use Contao\StringUtil;
use Netzmacht\Contao\Leaflet\Mapper\DefinitionMapper; use Netzmacht\Contao\Leaflet\Mapper\DefinitionMapper;
use Netzmacht\Contao\Leaflet\Mapper\Request; use Netzmacht\Contao\Leaflet\Mapper\Request;
use Netzmacht\LeafletPHP\Definition; use Netzmacht\LeafletPHP\Definition;
@@ -68,7 +69,7 @@ class AttributionControlMapper extends AbstractControlMapper
$parent->setAttributionControl(false); $parent->setAttributionControl(false);
} }
$attributions = deserialize($model->attributions, true); $attributions = StringUtil::deserialize($model->attributions, true);
foreach ($attributions as $attribution) { foreach ($attributions as $attribution) {
$definition->addAttribution($attribution); $definition->addAttribution($attribution);

View File

@@ -170,7 +170,7 @@ class MarkersLayerMapper extends AbstractLayerMapper implements GeoJsonMapper
* @param Model $model The layer model. * @param Model $model The layer model.
* @param Request $request Optional building request. * @param Request $request Optional building request.
* *
* @return \Model\Collection|null * @return \Contao\Model\Collection|null
*/ */
protected function loadMarkerModels(Model $model, Request $request = null) protected function loadMarkerModels(Model $model, Request $request = null)
{ {

View File

@@ -13,6 +13,7 @@
namespace Netzmacht\Contao\Leaflet\Mapper\Layer; namespace Netzmacht\Contao\Leaflet\Mapper\Layer;
use Contao\Model; use Contao\Model;
use Contao\StringUtil;
use Netzmacht\Contao\Leaflet\Definition\Layer\OverpassLayer; use Netzmacht\Contao\Leaflet\Definition\Layer\OverpassLayer;
use Netzmacht\Contao\Leaflet\Mapper\DefinitionMapper; use Netzmacht\Contao\Leaflet\Mapper\DefinitionMapper;
use Netzmacht\Contao\Leaflet\Mapper\Request; use Netzmacht\Contao\Leaflet\Mapper\Request;
@@ -146,7 +147,7 @@ class OverpassLayerMapper extends AbstractLayerMapper
*/ */
private function filterAmenityIconsConfig($amenityIconsConfig) private function filterAmenityIconsConfig($amenityIconsConfig)
{ {
$amenityIconsConfig = deserialize($amenityIconsConfig, true); $amenityIconsConfig = StringUtil::deserialize($amenityIconsConfig, true);
$amenityIconsMap = []; $amenityIconsMap = [];
foreach ($amenityIconsConfig as $config) { foreach ($amenityIconsConfig as $config) {

View File

@@ -188,11 +188,11 @@ class VectorsLayerMapper extends AbstractLayerMapper implements GeoJsonMapper
* Add javascript callbacks. * Add javascript callbacks.
* *
* @param GeoJson $definition The definition. * @param GeoJson $definition The definition.
* @param \Model $model The database model. * @param Model $model The database model.
* *
* @return void * @return void
*/ */
protected function addCallbacks(GeoJson $definition, \Model $model) protected function addCallbacks(GeoJson $definition, Model $model)
{ {
if ($model->pointToLayer) { if ($model->pointToLayer) {
$definition->setPointToLayer(new Expression($model->pointToLayer)); $definition->setPointToLayer(new Expression($model->pointToLayer));

View File

@@ -13,6 +13,7 @@
namespace Netzmacht\Contao\Leaflet\Mapper; namespace Netzmacht\Contao\Leaflet\Mapper;
use Contao\Model; use Contao\Model;
use Contao\StringUtil;
use Netzmacht\Contao\Leaflet\Model\ControlModel; use Netzmacht\Contao\Leaflet\Model\ControlModel;
use Netzmacht\Contao\Leaflet\Model\MapModel; use Netzmacht\Contao\Leaflet\Model\MapModel;
use Netzmacht\Contao\Toolkit\Data\Model\RepositoryManager; use Netzmacht\Contao\Toolkit\Data\Model\RepositoryManager;
@@ -195,7 +196,7 @@ class MapMapper extends AbstractMapper
*/ */
private function buildBoundsCalculation(Map $map, MapModel $model) private function buildBoundsCalculation(Map $map, MapModel $model)
{ {
$adjustBounds = deserialize($model->adjustBounds, true); $adjustBounds = StringUtil::deserialize($model->adjustBounds, true);
if (in_array('deferred', $adjustBounds)) { if (in_array('deferred', $adjustBounds)) {
$map->setOption('adjustBounds', true); $map->setOption('adjustBounds', true);

View File

@@ -131,7 +131,7 @@ class OptionsBuilder
* Build options and conditional options. * Build options and conditional options.
* *
* @param Definition $definition The definition being built. * @param Definition $definition The definition being built.
* @param \Model $model The model. * @param Model $model The model.
* *
* @return $this * @return $this
*/ */
@@ -147,7 +147,7 @@ class OptionsBuilder
* Build options. * Build options.
* *
* @param Definition $definition The definition being built. * @param Definition $definition The definition being built.
* @param \Model $model The model. * @param Model $model The model.
* *
* @return void * @return void
*/ */
@@ -160,11 +160,11 @@ class OptionsBuilder
* Build conditional options. * Build conditional options.
* *
* @param Definition $definition The definition being built. * @param Definition $definition The definition being built.
* @param \Model $model The model. * @param Model $model The model.
* *
* @return void * @return void
*/ */
private function buildConditionals($definition, \Model $model) private function buildConditionals($definition, Model $model)
{ {
foreach ($this->conditional as $column => $conditions) { foreach ($this->conditional as $column => $conditions) {
foreach ($conditions as $value => $options) { foreach ($conditions as $value => $options) {

View File

@@ -12,6 +12,7 @@
namespace Netzmacht\Contao\Leaflet\Mapper\Type; namespace Netzmacht\Contao\Leaflet\Mapper\Type;
use Contao\File;
use Contao\FilesModel; use Contao\FilesModel;
use Contao\Model; use Contao\Model;
use Netzmacht\Contao\Leaflet\Mapper\DefinitionMapper; use Netzmacht\Contao\Leaflet\Mapper\DefinitionMapper;
@@ -118,7 +119,7 @@ class ImageIconMapper extends AbstractIconMapper
if ($file) { if ($file) {
$definition->setIconUrl($file->path); $definition->setIconUrl($file->path);
$file = new \File($file->path); $file = new File($file->path);
$definition->setIconSize([$file->width, $file->height]); $definition->setIconSize([$file->width, $file->height]);
if (!$model->iconAnchor) { if (!$model->iconAnchor) {
@@ -162,7 +163,7 @@ class ImageIconMapper extends AbstractIconMapper
if ($file) { if ($file) {
$definition->setShadowUrl($file->path); $definition->setShadowUrl($file->path);
$file = new \File($file->path); $file = new File($file->path);
$definition->setShadowSize([$file->width, $file->height]); $definition->setShadowSize([$file->width, $file->height]);
if (!$model->shadowAnchor) { if (!$model->shadowAnchor) {

View File

@@ -13,6 +13,7 @@
namespace Netzmacht\Contao\Leaflet\Mapper\UI; namespace Netzmacht\Contao\Leaflet\Mapper\UI;
use Contao\Model; use Contao\Model;
use Contao\StringUtil;
use Netzmacht\Contao\Leaflet\Mapper\AbstractMapper; use Netzmacht\Contao\Leaflet\Mapper\AbstractMapper;
use Netzmacht\Contao\Leaflet\Mapper\DefinitionMapper; use Netzmacht\Contao\Leaflet\Mapper\DefinitionMapper;
use Netzmacht\Contao\Leaflet\Mapper\Request; use Netzmacht\Contao\Leaflet\Mapper\Request;
@@ -76,9 +77,9 @@ class PopupMapper extends AbstractMapper
if ($model->autoPan) { if ($model->autoPan) {
$padding = array_map( $padding = array_map(
function ($value) { function ($value) {
return array_map('intval', trimsplit(',', $value)); return array_map('intval', StringUtil::trimsplit(',', $value));
}, },
deserialize($model->autoPanPadding, true) StringUtil::deserialize($model->autoPanPadding, true)
); );
if ($padding[0] === $padding[1]) { if ($padding[0] === $padding[1]) {

View File

@@ -13,6 +13,7 @@
namespace Netzmacht\Contao\Leaflet\Mapper\Vector; namespace Netzmacht\Contao\Leaflet\Mapper\Vector;
use Contao\Model; use Contao\Model;
use Contao\StringUtil;
use Netzmacht\Contao\Leaflet\Mapper\DefinitionMapper; use Netzmacht\Contao\Leaflet\Mapper\DefinitionMapper;
use Netzmacht\Contao\Leaflet\Mapper\Request; use Netzmacht\Contao\Leaflet\Mapper\Request;
use Netzmacht\LeafletPHP\Definition; use Netzmacht\LeafletPHP\Definition;
@@ -67,7 +68,7 @@ class MultiPolylineMapper extends AbstractVectorMapper
*/ */
protected function createLatLngs(Polyline $definition, Model $model) protected function createLatLngs(Polyline $definition, Model $model)
{ {
foreach (deserialize($model->multiData, true) as $ring => $data) { foreach (StringUtil::deserialize($model->multiData, true) as $ring => $data) {
$latLngs = array_map( $latLngs = array_map(
function ($row) { function ($row) {
return LatLng::fromString($row); return LatLng::fromString($row);

View File

@@ -13,6 +13,7 @@
namespace Netzmacht\Contao\Leaflet\Mapper\Vector; namespace Netzmacht\Contao\Leaflet\Mapper\Vector;
use Contao\Model; use Contao\Model;
use Contao\StringUtil;
use Netzmacht\Contao\Leaflet\Mapper\DefinitionMapper; use Netzmacht\Contao\Leaflet\Mapper\DefinitionMapper;
use Netzmacht\Contao\Leaflet\Mapper\Request; use Netzmacht\Contao\Leaflet\Mapper\Request;
use Netzmacht\LeafletPHP\Definition\Vector\Rectangle; use Netzmacht\LeafletPHP\Definition\Vector\Rectangle;
@@ -53,7 +54,7 @@ class RectangleMapper extends AbstractVectorMapper
function ($latLng) { function ($latLng) {
return LatLng::fromString($latLng); return LatLng::fromString($latLng);
}, },
deserialize($model->bounds, true) StringUtil::deserialize($model->bounds, true)
); );
$arguments = parent::buildConstructArguments($model, $mapper, $request, $elementId); $arguments = parent::buildConstructArguments($model, $mapper, $request, $elementId);

View File

@@ -12,6 +12,7 @@
namespace Netzmacht\Contao\Leaflet\Model; namespace Netzmacht\Contao\Leaflet\Model;
use Contao\Model;
use Contao\Model\Collection; use Contao\Model\Collection;
/** /**
@@ -19,7 +20,7 @@ use Contao\Model\Collection;
* *
* @package Netzmacht\Contao\Leaflet\Model * @package Netzmacht\Contao\Leaflet\Model
*/ */
abstract class AbstractActiveModel extends \Model abstract class AbstractActiveModel extends Model
{ {
/** /**
* Find an active model by its model id. * Find an active model by its model id.

View File

@@ -12,7 +12,8 @@
namespace Netzmacht\Contao\Leaflet\Model; namespace Netzmacht\Contao\Leaflet\Model;
use Model\Collection; use Contao\Database;
use Contao\Model\Collection;
/** /**
* Class ControlModel for the tl_leaflet_vector table. * Class ControlModel for the tl_leaflet_vector table.
@@ -42,7 +43,7 @@ LEFT JOIN tl_leaflet_control_layer c ON l.id = c.lid
WHERE c.cid=? WHERE c.cid=?
SQL; SQL;
$result = \Database::getInstance() $result = Database::getInstance()
->prepare($query) ->prepare($query)
->execute($this->id); ->execute($this->id);
@@ -68,7 +69,7 @@ c ON l.id = c.lid
WHERE c.cid=? AND l.active=1 WHERE c.cid=? AND l.active=1
SQL; SQL;
$result = \Database::getInstance() $result = Database::getInstance()
->prepare($query) ->prepare($query)
->execute($this->id); ->execute($this->id);

View File

@@ -12,7 +12,7 @@
namespace Netzmacht\Contao\Leaflet\Model; namespace Netzmacht\Contao\Leaflet\Model;
use Model\Collection; use Contao\Model\Collection;
/** /**
* Class LayerModel for the tl_leaflet_layer table. * Class LayerModel for the tl_leaflet_layer table.

View File

@@ -12,7 +12,9 @@
namespace Netzmacht\Contao\Leaflet\Model; namespace Netzmacht\Contao\Leaflet\Model;
use Model\Collection; use Contao\Database;
use Contao\Model;
use Contao\Model\Collection;
/** /**
* Class MapModel for the tl_leaflet_map table. * Class MapModel for the tl_leaflet_map table.
@@ -22,7 +24,7 @@ use Model\Collection;
* *
* @package Netzmacht\Contao\Leaflet\Model * @package Netzmacht\Contao\Leaflet\Model
*/ */
class MapModel extends \Model class MapModel extends Model
{ {
/** /**
* Model table. * Model table.
@@ -39,7 +41,7 @@ class MapModel extends \Model
public function findLayers() public function findLayers()
{ {
$query = 'SELECT l.* FROM tl_leaflet_layer l LEFT JOIN tl_leaflet_map_layer m ON l.id = m.lid WHERE m.mid=?'; $query = 'SELECT l.* FROM tl_leaflet_layer l LEFT JOIN tl_leaflet_map_layer m ON l.id = m.lid WHERE m.mid=?';
$result = \Database::getInstance() $result = Database::getInstance()
->prepare($query) ->prepare($query)
->execute($this->id); ->execute($this->id);
@@ -65,7 +67,7 @@ ON l.id = m.lid
WHERE m.mid=? AND l.active=1 WHERE m.mid=? AND l.active=1
SQL; SQL;
$result = \Database::getInstance()->prepare($query)->execute($this->id); $result = Database::getInstance()->prepare($query)->execute($this->id);
if ($result->numRows) { if ($result->numRows) {
return Collection::createFromDbResult($result, 'tl_leaflet_layer'); return Collection::createFromDbResult($result, 'tl_leaflet_layer');

View File

@@ -36,7 +36,7 @@ class MarkerModel extends AbstractActiveModel
* @param int $pid The parent id. * @param int $pid The parent id.
* @param Filter $filter The filter. * @param Filter $filter The filter.
* *
* @return \Model\Collection|null * @return \Contao\Model\Collection|null
*/ */
public static function findByFilter($pid, Filter $filter = null) public static function findByFilter($pid, Filter $filter = null)
{ {
@@ -59,7 +59,7 @@ class MarkerModel extends AbstractActiveModel
* @param int $pid The layer id. * @param int $pid The layer id.
* @param BboxFilter $filter The bbox filter. * @param BboxFilter $filter The bbox filter.
* *
* @return \Model\Collection|null * @return \Contao\Model\Collection|null
*/ */
public static function findByBBoxFilter($pid, BboxFilter $filter) public static function findByBBoxFilter($pid, BboxFilter $filter)
{ {