You are here

PrivateMessageMapper.php in Open Social 10.3.x

File

modules/social_features/social_private_message/src/Mapper/PrivateMessageMapper.php
View source
<?php

namespace Drupal\social_private_message\Mapper;

use Drupal\private_message\Mapper\PrivateMessageMapper as PrivateMessageMapperBase;
use Drupal\social_profile\SocialProfileTrait;

/**
 * Class PrivateMessageMapper.
 *
 * @package Drupal\social_private_message\Mapper
 */
class PrivateMessageMapper extends PrivateMessageMapperBase {
  use SocialProfileTrait;

  /**
   * {@inheritdoc}
   */
  public function getUserIdsFromString($string, $count) {
    if ($this->currentUser
      ->hasPermission('access user profiles') && $this->currentUser
      ->hasPermission('use private messaging system')) {
      return $this
        ->getUserIdsFromName($string, $count);
    }
    return [];
  }

}

Classes

Namesort descending Description
PrivateMessageMapper Class PrivateMessageMapper.