3 namespace Drupal\quickedit\Ajax;
5 use Drupal\Core\Ajax\BaseCommand;
8 * AJAX command to indicate a field was saved into PrivateTempStore without
9 * validation errors and pass the rerendered field to Quick Edit's JavaScript
12 class FieldFormSavedCommand extends BaseCommand {
15 * The same re-rendered edited field, but in different view modes.
19 protected $other_view_modes;
22 * Constructs a FieldFormSavedCommand object.
25 * The re-rendered edited field to pass on to the client side.
26 * @param array $other_view_modes
27 * The same re-rendered edited field, but in different view modes, for other
28 * instances of the same field on the user's page. Keyed by view mode.
30 public function __construct($data, $other_view_modes = []) {
31 parent::__construct('quickeditFieldFormSaved', $data);
33 $this->other_view_modes = $other_view_modes;
39 public function render() {
41 'command' => $this->command,
42 'data' => $this->data,
43 'other_view_modes' => $this->other_view_modes,