You are here

class ImportOptions in GatherContent 8.4

Same name and namespace in other branches
  1. 8.5 src/Import/ImportOptions.php \Drupal\gathercontent\Import\ImportOptions

A class for storing and serializing the import/update options of a node.

Hierarchy

Expanded class hierarchy of ImportOptions

7 files declare their use of ImportOptions
ContentImportSelectForm.php in gathercontent_ui/src/Form/ContentImportSelectForm.php
ContentProcessor.php in src/Import/ContentProcess/ContentProcessor.php
ContentProcessorTest.php in tests/src/Kernel/ContentProcessorTest.php
ContentUpdateConfirmForm.php in gathercontent_ui/src/Form/ContentUpdateConfirmForm.php
gathercontent.drush.inc in ./gathercontent.drush.inc
Drush command to cli config import.

... See full list

File

src/Import/ImportOptions.php, line 8

Namespace

Drupal\gathercontent\Import
View source
class ImportOptions {

  /**
   * Decides how to import the node.
   *
   * @var string
   *
   * @see \Drupal\gathercontent\Import\NodeUpdateMethod
   */
  public $nodeUpdateMethod = NodeUpdateMethod::ALWAYS_UPDATE;

  /**
   * Decides to create a new revision or not.
   *
   * @var bool
   */
  public $createNewRevision = FALSE;

  /**
   * Decides whether to publish the imported node.
   *
   * @var bool
   */
  public $publish = FALSE;

  /**
   * ID of a GatherContent status.
   *
   * If set, status of the imported node will be updated both in GatherContent and Drupal.
   *
   * @var int
   */
  public $newStatus = NULL;

  /**
   * ID of a Drupal menu item.
   *
   * If set, imported node will be a menu item.
   *
   * @var string
   */
  public $parentMenuItem = NULL;

  /**
   * The UUID of the Operation entity this node import's OperationItem entity connects to.
   */
  public $operationUuid = NULL;

  /**
   * ImportOptions constructor.
   */
  public function __construct($node_update_method = NodeUpdateMethod::ALWAYS_UPDATE, $publish = FALSE, $create_new_revision = FALSE, $new_status = NULL, $parent_menu_item = NULL, $operation_uuid = NULL) {
    $this->nodeUpdateMethod = $node_update_method;
    $this->createNewRevision = $create_new_revision;
    $this->publish = $publish;
    $this->newStatus = filter_var($new_status, FILTER_VALIDATE_INT);
    $this->parentMenuItem = $parent_menu_item;
    $this->operationUuid = $operation_uuid;
  }

  /**
   * Getter $nodeUpdateMethod.
   */
  public function getNodeUpdateMethod() {
    return $this->nodeUpdateMethod;
  }

  /**
   * Setter $nodeUpdateMethod.
   */
  public function setNodeUpdateMethod($nodeUpdateMethod) {
    $this->nodeUpdateMethod = $nodeUpdateMethod;
    return $this;
  }

  /**
   * Getter $createNewRevision.
   */
  public function getCreateNewRevision() {
    return $this->createNewRevision;
  }

  /**
   * Setter $createNewRevision.
   */
  public function setCreateNewRevision($createNewRevision) {
    $this->createNewRevision = $createNewRevision;
    return $this;
  }

  /**
   * Getter $publish.
   */
  public function getPublish() {
    return $this->publish;
  }

  /**
   * Setter $publish.
   */
  public function setPublish($publish) {
    $this->publish = $publish;
    return $this;
  }

  /**
   * Getter $newStatus.
   */
  public function getNewStatus() {
    return $this->newStatus;
  }

  /**
   * Setter $newStatus.
   */
  public function setNewStatus($new_status) {
    $this->newStatus = $new_status;
    return $this;
  }

  /**
   * Getter $parentMenuItem.
   */
  public function getParentMenuItem() {
    return $this->parentMenuItem;
  }

  /**
   * Setter $parentMenuItem.
   */
  public function setParentMenuItem($parent_menu_item) {
    $this->parentMenuItem = $parent_menu_item;
    return $this;
  }

  /**
   * Getter $operation_uuid.
   */
  public function getOperationUuid() {
    return $this->operationUuid;
  }

  /**
   * Setter $operation_uuid.
   */
  public function setOperationUuid($operation_uuid) {
    $this->operationUuid = $operation_uuid;
    return $this;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ImportOptions::$createNewRevision public property Decides to create a new revision or not.
ImportOptions::$newStatus public property ID of a GatherContent status.
ImportOptions::$nodeUpdateMethod public property Decides how to import the node.
ImportOptions::$operationUuid public property The UUID of the Operation entity this node import's OperationItem entity connects to.
ImportOptions::$parentMenuItem public property ID of a Drupal menu item.
ImportOptions::$publish public property Decides whether to publish the imported node.
ImportOptions::getCreateNewRevision public function Getter $createNewRevision.
ImportOptions::getNewStatus public function Getter $newStatus.
ImportOptions::getNodeUpdateMethod public function Getter $nodeUpdateMethod.
ImportOptions::getOperationUuid public function Getter $operation_uuid.
ImportOptions::getParentMenuItem public function Getter $parentMenuItem.
ImportOptions::getPublish public function Getter $publish.
ImportOptions::setCreateNewRevision public function Setter $createNewRevision.
ImportOptions::setNewStatus public function Setter $newStatus.
ImportOptions::setNodeUpdateMethod public function Setter $nodeUpdateMethod.
ImportOptions::setOperationUuid public function Setter $operation_uuid.
ImportOptions::setParentMenuItem public function Setter $parentMenuItem.
ImportOptions::setPublish public function Setter $publish.
ImportOptions::__construct public function ImportOptions constructor.