You are here

public function PreviewLinkStorage::create in Preview Link 8

Constructs a new entity object, without permanently saving it.

Parameters

array $values: (optional) An array of values to set, keyed by property name. If the entity type has bundles, the bundle key has to be specified.

Return value

\Drupal\Core\Entity\EntityInterface A new entity object.

Overrides EntityStorageBase::create

1 call to PreviewLinkStorage::create()
PreviewLinkStorage::createPreviewLink in src/PreviewLinkStorage.php
Creates a new preview link from a entity type Id and entity Id.

File

src/PreviewLinkStorage.php, line 120

Class

PreviewLinkStorage
Preview Link entity storage.

Namespace

Drupal\preview_link

Code

public function create(array $values = []) {
  return parent::create($values + [
    'token' => $this
      ->generateUniqueToken(),
    'generated_timestamp' => $this->time
      ->getRequestTime(),
  ]);
}