PlatformBranding.php in Open Social 10.2.x
File
modules/social_features/social_branding/src/Plugin/GraphQL/DataProducer/PlatformBranding.php
View source
<?php
namespace Drupal\social_branding\Plugin\GraphQL\DataProducer;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Config\ImmutableConfig;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\graphql\Plugin\GraphQL\DataProducer\DataProducerPluginBase;
use Symfony\Component\DependencyInjection\ContainerInterface;
class PlatformBranding extends DataProducerPluginBase implements ContainerFactoryPluginInterface {
protected $config;
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new static($configuration, $plugin_id, $plugin_definition, $container
->get('config.factory'));
}
public function __construct(array $configuration, string $plugin_id, array $plugin_definition, ConfigFactoryInterface $config_factory) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->config = $config_factory;
}
public function resolve() : ?ImmutableConfig {
return $this->config
->get('system.theme');
}
}