protected function FeedsCommonTrait::reloadEntity in Feeds 8.3
Reloads an entity.
Parameters
\Drupal\Core\Entity\EntityInterface $entity: The entity to reload.
Return value
\Drupal\Core\Entity\EntityInterface The reloaded entity.
35 calls to FeedsCommonTrait::reloadEntity()
- CronTest::test in tests/
src/ Functional/ CronTest.php - Tests importing through cron.
- DependencyTest::testBundleDependency in tests/
src/ Kernel/ DependencyTest.php - Tests dependency on bundle.
- DependencyTest::testFieldDependency in tests/
src/ Kernel/ DependencyTest.php - Tests dependency on a single field.
- EntityIdTest::testNoNodeIdChange in tests/
src/ Kernel/ EntityIdTest.php - Tests that node ID's don't change and that existing nodes are not hijacked.
- EntityIdTest::testUpdateByNodeId in tests/
src/ Kernel/ EntityIdTest.php - Tests updating an existing node using node ID.
File
- tests/
src/ Traits/ FeedsCommonTrait.php, line 116
Class
- FeedsCommonTrait
- Provides methods useful for Kernel and Functional Feeds tests.
Namespace
Drupal\Tests\feeds\TraitsCode
protected function reloadEntity(EntityInterface $entity) {
/** @var \Drupal\Core\Entity\ $storageEntityStorageInterface */
$storage = $this->container
->get('entity_type.manager')
->getStorage($entity
->getEntityTypeId());
$storage
->resetCache([
$entity
->id(),
]);
return $storage
->load($entity
->id());
}