Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. FixedTimeProvider.php

class FixedTimeProvider

FixedTimeProvider uses a known time to provide the time

This provider allows the use of a previously-generated, or known, time when generating time-based UUIDs.

Hierarchy

  • class \Ramsey\Uuid\Provider\Time\FixedTimeProvider implements \Ramsey\Uuid\Provider\TimeProviderInterface

Expanded class hierarchy of FixedTimeProvider

1 file declares its use of FixedTimeProvider
UuidFactory.php in vendor/ramsey/uuid/src/UuidFactory.php

File

vendor/ramsey/uuid/src/Provider/Time/FixedTimeProvider.php, line 27

Namespace

Ramsey\Uuid\Provider\Time
View source
class FixedTimeProvider implements TimeProviderInterface {
    public function __construct(Time $time) {
    }
    
    /**
     * Sets the `usec` component of the time
     *
     * @param int|string|IntegerObject $value The `usec` value to set
     */
    public function setUsec($value) : void {
        $this->time = new Time($this->time
            ->getSeconds(), $value);
    }
    
    /**
     * Sets the `sec` component of the time
     *
     * @param int|string|IntegerObject $value The `sec` value to set
     */
    public function setSec($value) : void {
        $this->time = new Time($value, $this->time
            ->getMicroseconds());
    }
    public function getTime() : Time {
        return $this->time;
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title
FixedTimeProvider::getTime public function Returns a time object Overrides TimeProviderInterface::getTime
FixedTimeProvider::setSec public function Sets the `sec` component of the time
FixedTimeProvider::setUsec public function Sets the `usec` component of the time
FixedTimeProvider::__construct public function
RSS feed
Powered by Drupal