private function createSetting($dbResult, $filterSettings)
    {
        $factory = $this->getTypeFactory($dbResult['type']);
        if ($factory) {
            $setting = $factory->createInstance($dbResult, $filterSettings);

            if (!$setting) {
                return null;
            }

            // Collect next level.
            if ($factory->isNestedType()) {
                /** @var IWithChildren $setting */
                $this->collectRulesFor($setting, $filterSettings);
            }

            return $setting;
        }

        return null;
    }