SocialPrivateMessageEntityAutocomplete.php in Open Social 8.8
Same filename and directory in other branches
- 8.9 modules/social_features/social_private_message/src/Element/SocialPrivateMessageEntityAutocomplete.php
- 8.2 modules/social_features/social_private_message/src/Element/SocialPrivateMessageEntityAutocomplete.php
- 8.3 modules/social_features/social_private_message/src/Element/SocialPrivateMessageEntityAutocomplete.php
- 8.4 modules/social_features/social_private_message/src/Element/SocialPrivateMessageEntityAutocomplete.php
- 8.5 modules/social_features/social_private_message/src/Element/SocialPrivateMessageEntityAutocomplete.php
- 8.6 modules/social_features/social_private_message/src/Element/SocialPrivateMessageEntityAutocomplete.php
- 8.7 modules/social_features/social_private_message/src/Element/SocialPrivateMessageEntityAutocomplete.php
- 10.3.x modules/social_features/social_private_message/src/Element/SocialPrivateMessageEntityAutocomplete.php
- 10.0.x modules/social_features/social_private_message/src/Element/SocialPrivateMessageEntityAutocomplete.php
- 10.1.x modules/social_features/social_private_message/src/Element/SocialPrivateMessageEntityAutocomplete.php
- 10.2.x modules/social_features/social_private_message/src/Element/SocialPrivateMessageEntityAutocomplete.php
Namespace
Drupal\social_private_message\ElementFile
modules/social_features/social_private_message/src/Element/SocialPrivateMessageEntityAutocomplete.phpView source
<?php
namespace Drupal\social_private_message\Element;
use Drupal\Core\Form\FormStateInterface;
use Drupal\social_core\Entity\Element\EntityAutocomplete;
/**
* Provides an private message member autocomplete form element.
*
* The #default_value accepted by this element is either an entity object or an
* array of entity objects.
*
* @FormElement("social_private_message_entity_autocomplete")
*/
class SocialPrivateMessageEntityAutocomplete extends EntityAutocomplete {
/**
* Form element validation handler for entity_autocomplete elements.
*/
public static function validateEntityAutocomplete(array &$element, FormStateInterface $form_state, array &$complete_form) {
parent::validateEntityAutocomplete($element, $form_state, $complete_form);
$value = $form_state
->getValue('members');
$form_state
->setValue('members', $value['target_id']);
}
}
Classes
Name | Description |
---|---|
SocialPrivateMessageEntityAutocomplete | Provides an private message member autocomplete form element. |