function StubEntityStorageBase::has

Same name and namespace in other branches
  1. 11.x core/tests/Drupal/Tests/Core/Entity/StubEntityStorageBase.php \Drupal\Tests\Core\Entity\StubEntityStorageBase::has()

Determines if this entity already exists in storage.

Parameters

int|string $id: The original entity ID.

\Drupal\Core\Entity\EntityInterface $entity: The entity being saved.

Return value

bool TRUE if this entity exists in storage, FALSE otherwise.

Overrides EntityStorageBase::has

File

core/tests/Drupal/Tests/Core/Entity/StubEntityStorageBase.php, line 34

Class

StubEntityStorageBase
A stub base entity storage for testing purposes.

Namespace

Drupal\Tests\Core\Entity

Code

protected function has($id, EntityInterface $entity) : bool {
  return FALSE;
}

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