function ContentModerationState::getCurrentUserId

Default value callback for the 'uid' base field definition.

Return value

array An array of default values.

Deprecated

The ::getCurrentUserId method is deprecated in 8.6.x and will be removed before 9.0.0.

See also

\Drupal\content_moderation\Entity\ContentModerationState::baseFieldDefinitions()

1 call to ContentModerationState::getCurrentUserId()
ContentModerationStateTest::testGetCurrentUserId in core/modules/content_moderation/tests/src/Kernel/ContentModerationStateTest.php
Tests the legacy method used as the default entity owner.

File

core/modules/content_moderation/src/Entity/ContentModerationState.php, line 165

Class

ContentModerationState
Defines the Content moderation state entity.

Namespace

Drupal\content_moderation\Entity

Code

public static function getCurrentUserId() {
    @trigger_error('The ::getCurrentUserId method is deprecated in 8.6.x and will be removed before 9.0.0.', E_USER_DEPRECATED);
    return [
        \Drupal::currentUser()->id(),
    ];
}

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