class SerializableTempstoreFactory

A factory for creating SerializableTempStore objects.

Hierarchy

Expanded class hierarchy of SerializableTempstoreFactory

Deprecated

in ctools 8.x-3.10. Will be removed before ctools:4.0.0. Use \Drupal\Core\TempStore\SharedTempStoreFactory instead.

1 string reference to 'SerializableTempstoreFactory'
ctools.services.yml in ./ctools.services.yml
ctools.services.yml
1 service uses SerializableTempstoreFactory
ctools.serializable.tempstore.factory in ./ctools.services.yml
Drupal\ctools\SerializableTempstoreFactory

File

src/SerializableTempstoreFactory.php, line 18

Namespace

Drupal\ctools
View source
class SerializableTempstoreFactory extends SharedTempStoreFactory {
  
  /**
   * {@inheritdoc}
   */
  public function get($collection, $owner = NULL) {
    // Use the currently authenticated user ID or the active user ID unless the
    // owner is overridden.
    if (!isset($owner)) {
      $owner = $this->currentUser
        ->id() ?: session_id();
    }
    // Store the data for this collection in the database.
    $storage = $this->storageFactory
      ->get("tempstore.shared.{$collection}");
    return new CoreSharedTempStore($storage, $this->lockBackend, $owner, $this->requestStack, $this->currentUser, $this->expire);
  }

}

Members

Title Sort descending Modifiers Object type Summary
SerializableTempstoreFactory::get public function