Commit c917738a authored by mxh's avatar mxh
Browse files

Issue #3303079 by mxh: Add actions for updating existing group content

parent 5a1e2d42
Loading
Loading
Loading
Loading
+32 −0
Original line number Diff line number Diff line
<?php

namespace Drupal\group_action\Plugin\Action;

/**
 * Action plugin for updating content of a group.
 *
 * @Action(
 *   id = "group_update_content",
 *   label = "Group: update content",
 *   type = "node"
 * )
 *
 * @TODO, support multiple entity types once core is fixed.
 * @see https://www.drupal.org/node/2011038
 */
class GroupUpdateContent extends GroupActionBase {

  /**
   * {@inheritdoc}
   */
  public function defaultConfiguration() {
    return [
      'operation' => 'update',
      'content_plugin' => '',
      'group_id' => '',
      'entity_id' => '',
      'values' => '',
    ];
  }

}
+29 −0
Original line number Diff line number Diff line
<?php

namespace Drupal\group_action\Plugin\Action;

/**
 * Action plugin for updating an existing membership.
 *
 * @Action(
 *   id = "group_update_member",
 *   label = "Group: update user membership",
 *   type = "user"
 * )
 */
class GroupUpdateMember extends GroupUpdateContent {

  /**
   * {@inheritdoc}
   */
  public function defaultConfiguration() {
    return [
      'operation' => 'update',
      'content_plugin' => 'group_membership',
      'group_id' => '',
      'entity_id' => '',
      'values' => '',
    ];
  }

}