class FieldFormSavedCommand

Same name in other branches
  1. 8.9.x core/modules/quickedit/src/Ajax/FieldFormSavedCommand.php \Drupal\quickedit\Ajax\FieldFormSavedCommand

Indicates a field was saved and passes the rerendered field to Quick Edit.

Hierarchy

Expanded class hierarchy of FieldFormSavedCommand

1 file declares its use of FieldFormSavedCommand
QuickEditController.php in core/modules/quickedit/src/QuickEditController.php

File

core/modules/quickedit/src/Ajax/FieldFormSavedCommand.php, line 10

Namespace

Drupal\quickedit\Ajax
View source
class FieldFormSavedCommand extends BaseCommand {
    
    /**
     * The same re-rendered edited field, but in different view modes.
     *
     * @var array
     */
    protected $other_view_modes;
    
    /**
     * Constructs a FieldFormSavedCommand object.
     *
     * @param string $data
     *   The re-rendered edited field to pass on to the client side.
     * @param array $other_view_modes
     *   The same re-rendered edited field, but in different view modes, for other
     *   instances of the same field on the user's page. Keyed by view mode.
     */
    public function __construct($data, $other_view_modes = []) {
        parent::__construct('quickeditFieldFormSaved', $data);
        $this->other_view_modes = $other_view_modes;
    }
    
    /**
     * {@inheritdoc}
     */
    public function render() {
        return [
            'command' => $this->command,
            'data' => $this->data,
            'other_view_modes' => $this->other_view_modes,
        ];
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title
BaseCommand::$command protected property The name of the command.
BaseCommand::$data protected property The data to pass on to the client side.
FieldFormSavedCommand::$other_view_modes protected property The same re-rendered edited field, but in different view modes.
FieldFormSavedCommand::render public function Return an array to be run through json_encode and sent to the client. Overrides BaseCommand::render
FieldFormSavedCommand::__construct public function Constructs a FieldFormSavedCommand object. Overrides BaseCommand::__construct

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.