function MysqlServiceProvider::register

Same name and namespace in other branches
  1. 11.x core/modules/mysql/src/MysqlServiceProvider.php \Drupal\mysql\MysqlServiceProvider::register()

Overrides ServiceProviderBase::register

File

core/modules/mysql/src/MysqlServiceProvider.php, line 17

Class

MysqlServiceProvider
Registers the 'mysql.views.cast_sql' service when views is installed.

Namespace

Drupal\mysql

Code

public function register(ContainerBuilder $container) : void {
  if (isset($container->getParameter('container.modules')['views'])) {
    $container->register('mysql.views.cast_sql', MysqlCastSql::class)
      ->setPublic(FALSE);
  }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.