MetaModels\DcGeneral\Events\Table\FilterSetting\Subscriber::cleanDefaultIdOptions PHP Method

cleanDefaultIdOptions() protected method

Ensure that all options have a value.
protected cleanDefaultIdOptions ( array $options, boolean $onlyUsed, array $count ) : array
$options array The options to be cleaned.
$onlyUsed boolean Determines if only "used" values shall be returned.
$count array Array for the counted values.
return array
    protected function cleanDefaultIdOptions($options, $onlyUsed, $count)
    {
        // Remove empty values.
        foreach ($options as $mixKey => $mixValue) {
            // Remove html/php tags.
            $mixValue = trim(strip_tags($mixValue));
            if ($mixValue === '' || $mixValue === null || $onlyUsed && $count[$mixKey] === 0) {
                unset($options[$mixKey]);
            }
        }
        return $options;
    }