function LinkCollectionNormalizer::__construct

Same name in other branches
  1. 10 core/modules/jsonapi/src/Normalizer/LinkCollectionNormalizer.php \Drupal\jsonapi\Normalizer\LinkCollectionNormalizer::__construct()
  2. 11.x core/modules/jsonapi/src/Normalizer/LinkCollectionNormalizer.php \Drupal\jsonapi\Normalizer\LinkCollectionNormalizer::__construct()

LinkCollectionNormalizer constructor.

Parameters

\Drupal\Core\Session\AccountInterface $current_user: The current user.

File

core/modules/jsonapi/src/Normalizer/LinkCollectionNormalizer.php, line 82

Class

LinkCollectionNormalizer
Normalizes a LinkCollection object.

Namespace

Drupal\jsonapi\Normalizer

Code

public function __construct(AccountInterface $current_user = NULL) {
    if (is_null($current_user)) {
        @trigger_error('Calling ' . __METHOD__ . '() without the $current_user argument is deprecated in drupal:9.2.0 and will be required in drupal:10.0.0.', E_USER_DEPRECATED);
        $current_user = \Drupal::currentUser();
    }
    $this->currentUser = $current_user;
}

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