You are here

public function FarmGroupServiceProvider::alter in farmOS 2.x

Modifies existing service definitions.

Parameters

ContainerBuilder $container: The ContainerBuilder whose service definitions can be altered.

Overrides ServiceProviderBase::alter

File

modules/asset/group/src/FarmGroupServiceProvider.php, line 18

Class

FarmGroupServiceProvider
Override the asset.location service with our own class.

Namespace

Drupal\farm_group

Code

public function alter(ContainerBuilder $container) {
  $definition = $container
    ->getDefinition('asset.location');
  $definition
    ->addArgument(new Reference('group.membership'));
  $definition
    ->setClass('Drupal\\farm_group\\GroupAssetLocation');
}