protected function getUserId()
    {
        if (!$this->users) {
            $userStorage = $this->entityTypeManager->getStorage('user');

            $this->users = $userStorage->loadByProperties(['status' => true]);
        }

        return array_rand($this->users);
    }
protected function getUserId()
    {
        if (!$this->users) {
            $userStorage = $this->entityTypeManager->getStorage('user');

            $this->users = $userStorage->loadByProperties(['status' => true]);
        }

        return array_rand($this->users);
    }
protected function getUserId ( ) { if ( ! $ this -> users ) { $ userStorage = $ this -> entityTypeManager -> getStorage ( 'user' ) ; $ this -> users = $ userStorage -> loadByProperties ( [ 'status' => true ] ) ; } return array_rand ( $ this -> users ) ; }
Retrieve a random Uid of enabled users.

@return array
Retrieve a random Uid of enabled users .