public function FileFieldTestBase::getLastFileId in Drupal 10
Same name and namespace in other branches
- 8 core/modules/file/tests/src/Functional/FileFieldTestBase.php \Drupal\Tests\file\Functional\FileFieldTestBase::getLastFileId()
- 9 core/modules/file/tests/src/Functional/FileFieldTestBase.php \Drupal\Tests\file\Functional\FileFieldTestBase::getLastFileId()
Retrieves the fid of the last inserted file.
File
- core/
modules/ file/ tests/ src/ Functional/ FileFieldTestBase.php, line 76
Class
- FileFieldTestBase
- Provides methods specifically for testing File module's field handling.
Namespace
Drupal\Tests\file\FunctionalCode
public function getLastFileId() {
return (int) \Drupal::entityQueryAggregate('file')
->accessCheck(FALSE)
->aggregate('fid', 'max')
->execute()[0]['fid_max'];
}