You are here

class LingotekDocumentLockedException in Lingotek Translation 3.4.x

Same name and namespace in other branches
  1. 8.2 src/Exception/LingotekDocumentLockedException.php \Drupal\lingotek\Exception\LingotekDocumentLockedException
  2. 4.0.x src/Exception/LingotekDocumentLockedException.php \Drupal\lingotek\Exception\LingotekDocumentLockedException
  3. 3.0.x src/Exception/LingotekDocumentLockedException.php \Drupal\lingotek\Exception\LingotekDocumentLockedException
  4. 3.1.x src/Exception/LingotekDocumentLockedException.php \Drupal\lingotek\Exception\LingotekDocumentLockedException
  5. 3.2.x src/Exception/LingotekDocumentLockedException.php \Drupal\lingotek\Exception\LingotekDocumentLockedException
  6. 3.3.x src/Exception/LingotekDocumentLockedException.php \Drupal\lingotek\Exception\LingotekDocumentLockedException
  7. 3.5.x src/Exception/LingotekDocumentLockedException.php \Drupal\lingotek\Exception\LingotekDocumentLockedException
  8. 3.6.x src/Exception/LingotekDocumentLockedException.php \Drupal\lingotek\Exception\LingotekDocumentLockedException
  9. 3.7.x src/Exception/LingotekDocumentLockedException.php \Drupal\lingotek\Exception\LingotekDocumentLockedException
  10. 3.8.x src/Exception/LingotekDocumentLockedException.php \Drupal\lingotek\Exception\LingotekDocumentLockedException

An exception for issues when a document is already locked because a new version exists.

@package Drupal\lingotek\Exception

Hierarchy

Expanded class hierarchy of LingotekDocumentLockedException

18 files declare their use of LingotekDocumentLockedException
lingotek.batch.inc in ./lingotek.batch.inc
Lingotek batch functions
lingotek.module in ./lingotek.module
Implements Drupal-related hooks for the Lingotek Translation module.
Lingotek.php in src/Lingotek.php
LingotekConfigManagementForm.php in src/Form/LingotekConfigManagementForm.php
LingotekConfigTranslationController.php in src/Controller/LingotekConfigTranslationController.php

... See full list

File

src/Exception/LingotekDocumentLockedException.php, line 11

Namespace

Drupal\lingotek\Exception
View source
class LingotekDocumentLockedException extends LingotekException {

  /**
   * The old document id.
   *
   * @var string
   */
  protected $oldDocumentId;

  /**
   * The document id.
   *
   * @var string
   */
  protected $newDocumentId;

  /**
   * Construct the exception. Note: The message is NOT binary safe.
   *
   * @param string $old_document_id
   *   The old document id.
   * @param string $new_document_id
   *   The new document id
   * @param string $message
   *   (optional) The Exception message to throw.
   * @param int $code
   *   (optional) The Exception code.
   * @param \Throwable $previous
   *   (optional) The previous throwable used for the exception chaining.
   */
  public function __construct($old_document_id, $new_document_id, $message = "", int $code = 0, \Throwable $previous = NULL) {
    parent::__construct($message, $code, $previous);
    $this->oldDocumentId = $old_document_id;
    $this->newDocumentId = $new_document_id;
  }

  /**
   * Get the document id which was already locked.
   *
   * @return string
   */
  public function getOldDocumentId() {
    return $this->oldDocumentId;
  }

  /**
   * Get the new document id for that document.
   *
   * @return string
   */
  public function getNewDocumentId() {
    return $this->newDocumentId;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
LingotekDocumentLockedException::$newDocumentId protected property The document id.
LingotekDocumentLockedException::$oldDocumentId protected property The old document id.
LingotekDocumentLockedException::getNewDocumentId public function Get the new document id for that document.
LingotekDocumentLockedException::getOldDocumentId public function Get the document id which was already locked.
LingotekDocumentLockedException::__construct public function Construct the exception. Note: The message is NOT binary safe.