mirror of
https://github.com/netzmacht/contao-leaflet-maps.git
synced 2026-02-28 17:18:15 +01:00
Convert array syntax and other minor code style adjustments.
This commit is contained in:
@@ -29,7 +29,7 @@ abstract class AbstractActiveModel extends \Model
|
||||
*
|
||||
* @return \Model|null
|
||||
*/
|
||||
public static function findActiveByPK($modelId, $options = array())
|
||||
public static function findActiveByPK($modelId, $options = [])
|
||||
{
|
||||
return static::findOneBy('active=1 AND id', $modelId, $options);
|
||||
}
|
||||
@@ -43,7 +43,7 @@ abstract class AbstractActiveModel extends \Model
|
||||
*
|
||||
* @return Collection|null
|
||||
*/
|
||||
public static function findActiveBy($column, $value, $options = array())
|
||||
public static function findActiveBy($column, $value, $options = [])
|
||||
{
|
||||
if (is_array($column)) {
|
||||
$column[] = 'active=1';
|
||||
@@ -61,7 +61,7 @@ abstract class AbstractActiveModel extends \Model
|
||||
*
|
||||
* @return Collection|null
|
||||
*/
|
||||
public static function findActives($options = array())
|
||||
public static function findActives($options = [])
|
||||
{
|
||||
return static::findBy('active', '1', $options);
|
||||
}
|
||||
|
||||
@@ -42,18 +42,18 @@ class LayerModel extends AbstractActiveModel
|
||||
*
|
||||
* @return Collection|null
|
||||
*/
|
||||
public static function findMultipleByTypes(array $types, $options = array())
|
||||
public static function findMultipleByTypes(array $types, $options = [])
|
||||
{
|
||||
if (empty($types)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$options['column'] = array(
|
||||
$options['column'] = [
|
||||
sprintf(
|
||||
'type IN (%s)',
|
||||
substr(str_repeat('?,', count($types)), 0, -1)
|
||||
)
|
||||
);
|
||||
),
|
||||
];
|
||||
|
||||
$options['value'] = $types;
|
||||
$options['return'] = 'Collection';
|
||||
|
||||
@@ -41,7 +41,7 @@ class MarkerModel extends AbstractActiveModel
|
||||
public static function findByFilter($pid, Filter $filter = null)
|
||||
{
|
||||
if (!$filter) {
|
||||
return static::findActiveBy('pid', $pid, array('order' => 'sorting'));
|
||||
return static::findActiveBy('pid', $pid, ['order' => 'sorting']);
|
||||
}
|
||||
|
||||
switch ($filter->getName()) {
|
||||
@@ -63,23 +63,23 @@ class MarkerModel extends AbstractActiveModel
|
||||
*/
|
||||
public static function findByBBoxFilter($pid, BboxFilter $filter)
|
||||
{
|
||||
$columns = array(
|
||||
$columns = [
|
||||
'active=1',
|
||||
'pid=?',
|
||||
'latitude > ? AND latitude < ?',
|
||||
'longitude > ? AND longitude < ?'
|
||||
);
|
||||
'longitude > ? AND longitude < ?',
|
||||
];
|
||||
|
||||
/** @var LatLngBounds $bounds */
|
||||
$bounds = $filter->getValues()['bounds'];
|
||||
$values = array(
|
||||
$values = [
|
||||
$pid,
|
||||
$bounds->getSouthWest()->getLatitude(),
|
||||
$bounds->getNorthEast()->getLatitude(),
|
||||
$bounds->getSouthWest()->getLongitude(),
|
||||
$bounds->getNorthEast()->getLongitude()
|
||||
);
|
||||
$bounds->getNorthEast()->getLongitude(),
|
||||
];
|
||||
|
||||
return static::findBy($columns, $values, array('order' => 'sorting'));
|
||||
return static::findBy($columns, $values, ['order' => 'sorting']);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user