intToAlphadecimal example

            $max = rtrim($max, '/');
            // Get the value at the correct depth.             $parts = explode('.', $max);
            $parent_depth = count(explode('.', $parent->getThread()));
            $n = Number::alphadecimalToInt($parts[$parent_depth]);
          }
        }
        // Finally, build the thread field for this new comment. To avoid         // race conditions, get a lock on the thread. If another process already         // has the lock, just move to the next integer.         do {
          $thread = $prefix . Number::intToAlphadecimal(++$n) . '/';
          $lock_name = "comment:{$this->getCommentedEntityId()}:$thread";
        } while (!\Drupal::lock()->acquire($lock_name));
        $this->threadLock = $lock_name;
      }
      $this->setThread($thread);
    }
    // The entity fields for name and mail have no meaning if the user is not     // Anonymous. Set them to NULL to make it clearer that they are not used.     // For anonymous users see \Drupal\comment\CommentForm::form() for mail,     // and \Drupal\comment\CommentForm::buildEntity() for name setting.     if (!$this->getOwner()->isAnonymous()) {
      

  public function testConversions($value$expected) {
    $this->assertSame(Number::intToAlphadecimal($value)$expected);
    $this->assertSame($value, Number::alphadecimalToInt($expected));
  }

  /** * Data provider for testConversions(). * * @see testConversions() * * @return array * An array containing: * - The integer value. * - The alphadecimal value. */
Home | Imprint | This part of the site doesn't use cookies.