You are here

protected function OptimizedPhpArrayDumper::getPrivateServiceCall in Service Container 7

Same name and namespace in other branches
  1. 7.2 lib/Drupal/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumper.php \Drupal\Component\DependencyInjection\Dumper\OptimizedPhpArrayDumper::getPrivateServiceCall()

Gets a private service definition in a suitable format.

Parameters

string $id: The ID of the service to get a private definition for.

\Symfony\Component\DependencyInjection\Definition $definition: The definition to process.

bool $shared: (optional) Whether the service will be shared with others. By default this parameter is FALSE.

Return value

\stdClass A very lightweight private service value object.

2 calls to OptimizedPhpArrayDumper::getPrivateServiceCall()
OptimizedPhpArrayDumper::dumpValue in lib/Drupal/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumper.php
Dumps the value to PHP array format.
OptimizedPhpArrayDumper::getReferenceCall in lib/Drupal/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumper.php
Gets a service reference for a reference in a suitable PHP array format.

File

lib/Drupal/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumper.php, line 372
Contains \Drupal\Component\DependencyInjection\Dumper\OptimizedPhpArrayDumper.

Class

OptimizedPhpArrayDumper
OptimizedPhpArrayDumper dumps a service container as a serialized PHP array.

Namespace

Drupal\Component\DependencyInjection\Dumper

Code

protected function getPrivateServiceCall($id, Definition $definition, $shared = FALSE) {
  $service_definition = $this
    ->getServiceDefinition($definition);
  if (!$id) {
    $hash = hash('sha1', serialize($service_definition));
    $id = 'private__' . $hash;
  }
  return (object) array(
    'type' => 'private_service',
    'id' => $id,
    'value' => $service_definition,
    'shared' => $shared,
  );
}