function EntityStorageBase::has

Same name and namespace in other branches
  1. 11.x core/lib/Drupal/Core/Entity/EntityStorageBase.php \Drupal\Core\Entity\EntityStorageBase::has()
  2. 10 core/lib/Drupal/Core/Entity/EntityStorageBase.php \Drupal\Core\Entity\EntityStorageBase::has()
  3. 8.9.x core/lib/Drupal/Core/Entity/EntityStorageBase.php \Drupal\Core\Entity\EntityStorageBase::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.

1 method overrides EntityStorageBase::has()
SqlContentEntityStorage::has in core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php
Determines if this entity already exists in storage.

File

core/lib/Drupal/Core/Entity/EntityStorageBase.php, line 469

Class

EntityStorageBase
A base entity storage class.

Namespace

Drupal\Core\Entity

Code

abstract protected function has($id, EntityInterface $entity);

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