function EntityDataRepository::resolveFromStorage
File
-
vendor/
mglaman/ phpstan-drupal/ src/ Drupal/ EntityDataRepository.php, line 38
Class
Namespace
mglaman\PHPStanDrupal\DrupalCode
public function resolveFromStorage(ObjectType $callerType) : ?EntityData {
if ($callerType->equals(new ObjectType(EntityStorageInterface::class))) {
return null;
}
if ($callerType->equals(new ObjectType(ConfigEntityStorageInterface::class))) {
return null;
}
if ($callerType->equals(new ObjectType(ContentEntityStorageInterface::class))) {
return null;
}
foreach ($this->entityData as $entityData) {
$storageType = $entityData->getStorageType();
if ($storageType !== null && $callerType->isSuperTypeOf($storageType)
->yes()) {
return $entityData;
}
}
return null;
}