public function LinkCollectionNormalizer::__construct in Drupal 9
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\NormalizerCode
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;
}