Lock.php

Same filename and directory in other branches
  1. 11.x core/lib/Drupal/Core/TempStore/Lock.php
  2. 10 core/lib/Drupal/Core/TempStore/Lock.php
  3. 9 core/lib/Drupal/Core/TempStore/Lock.php
  4. 8.9.x core/lib/Drupal/Core/TempStore/Lock.php

Namespace

Drupal\Core\TempStore

File

core/lib/Drupal/Core/TempStore/Lock.php

View source
<?php

namespace Drupal\Core\TempStore;


/**
 * Provides a value object representing the lock from a TempStore.
 */
final class Lock {
  
  /**
   * Constructs a new Lock object.
   *
   * @param int $ownerId
   *   The owner ID.
   * @param int $updated
   *   The updated timestamp.
   */
  public function __construct(private $ownerId, private $updated) {
  }
  
  /**
   * Gets the owner ID.
   *
   * @return int
   *   The owner ID.
   */
  public function getOwnerId() {
    return $this->ownerId;
  }
  
  /**
   * Gets the timestamp of the last update to the lock.
   *
   * @return int
   *   The updated timestamp.
   */
  public function getUpdated() {
    return $this->updated;
  }

}

Classes

Title Deprecated Summary
Lock Provides a value object representing the lock from a TempStore.

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