MetaModels\DcGeneral\Events\Table\RenderSettings\Subscriber::getFilterSettings PHP Method

getFilterSettings() protected method

Retrieve the model filters for the MCW.
protected getFilterSettings ( ContaoCommunityAlliance\DcGeneral\Data\ModelInterface $model ) : array
$model ContaoCommunityAlliance\DcGeneral\Data\ModelInterface The model containing the currently edited render setting.
return array
    protected function getFilterSettings(ModelInterface $model)
    {
        $objFilters = $this->getDatabase()->prepare('SELECT id, name FROM tl_metamodel_filter WHERE pid = ?')->execute($model->getProperty('pid'));
        $result = array();
        while ($objFilters->next()) {
            /** @noinspection PhpUndefinedFieldInspection */
            $result[$objFilters->id] = $objFilters->name;
        }
        return $result;
    }