forked from Snck3rs/contao-leaflet-maps
Fix code style.
This commit is contained in:
@@ -11,28 +11,44 @@
|
||||
|
||||
namespace Netzmacht\Contao\Leaflet\Dca;
|
||||
|
||||
|
||||
use Netzmacht\Contao\DevTools\Dca\Options\OptionsBuilder;
|
||||
use Netzmacht\Contao\Leaflet\Model\IconModel;
|
||||
|
||||
/**
|
||||
* Class Marker is the dca helper class for the tl_leaflet_marker dca.
|
||||
*
|
||||
* @package Netzmacht\Contao\Leaflet\Dca
|
||||
*/
|
||||
class Marker
|
||||
{
|
||||
/**
|
||||
* Generate the row label.
|
||||
*
|
||||
* @param array $row Current data row.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function generateRow($row)
|
||||
{
|
||||
return $row['title'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all icons.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getIcons()
|
||||
{
|
||||
$collection = IconModel::findAll(array('order' => 'title'));
|
||||
$builder = OptionsBuilder::fromCollection(
|
||||
$collection, 'id',
|
||||
function($model) {
|
||||
$collection,
|
||||
'id',
|
||||
function ($model) {
|
||||
return sprintf('%s [%s]', $model['title'], $model['type']);
|
||||
}
|
||||
);
|
||||
|
||||
return $builder->getOptions();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user