public static function createByComponentSiteCode($component, $site_code)
{
$settings = static::fetchByComponentSiteCode($component, $site_code);
if (!$settings) {
$settings = new static(['component' => $component->className(), 'site_code' => $site_code]);
if ($component->namespace) {
$settings->namespace = $component->namespace;
}
$settings->save();
}
return $settings;
}