code: 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;
      }
docs: Create a new setting.
  
  @param array       $dbResult       The information from which to initialize the setting from.
  
  @param ICollection $filterSettings The MetaModel filter settings.
  
  @return ISimple|null