class PrivateMessageMembersAutocompleteResponseCommand in Private Message 8
Same name and namespace in other branches
- 8.2 src/Ajax/PrivateMessageMembersAutocompleteResponseCommand.php \Drupal\private_message\Ajax\PrivateMessageMembersAutocompleteResponseCommand
Ajax command to return autocomplete member results to the browser.
Hierarchy
- class \Drupal\private_message\Ajax\PrivateMessageMembersAutocompleteResponseCommand implements CommandInterface
Expanded class hierarchy of PrivateMessageMembersAutocompleteResponseCommand
1 file declares its use of PrivateMessageMembersAutocompleteResponseCommand
- AjaxController.php in src/
Controller/ AjaxController.php
File
- src/
Ajax/ PrivateMessageMembersAutocompleteResponseCommand.php, line 10
Namespace
Drupal\private_message\AjaxView source
class PrivateMessageMembersAutocompleteResponseCommand implements CommandInterface {
/**
* The string for which results should be returned.
*
* @var string
*/
protected $string;
/**
* The user information to be sent to the browser.
*
* @var array
* An array of user info, with each element of the array containing the
* following keys:
* - uid: The User ID of the user
* - username: The username of the user
*/
protected $userInfo;
/**
* Constructs a PrivateMessageMembersAutocompleteResponseCommand object.
*
* @param string $string
* The string that was searched for.
* @param array $userInfo
* An array of user info, with each element of the array containing the
* following keys:
* - uid: The User ID of the user
* - username: The username of the user.
*/
public function __construct($string, array $userInfo) {
$this->userInfo = $userInfo;
}
/**
* {@inheritdoc}
*/
public function render() {
return [
'command' => 'privateMessageMembersAutocompleteResponse',
'string' => $this->string,
'userInfo' => $this->userInfo,
];
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
PrivateMessageMembersAutocompleteResponseCommand:: |
protected | property | The string for which results should be returned. | |
PrivateMessageMembersAutocompleteResponseCommand:: |
protected | property | The user information to be sent to the browser. | |
PrivateMessageMembersAutocompleteResponseCommand:: |
public | function |
Return an array to be run through json_encode and sent to the client. Overrides CommandInterface:: |
|
PrivateMessageMembersAutocompleteResponseCommand:: |
public | function | Constructs a PrivateMessageMembersAutocompleteResponseCommand object. |