public function FileFieldTestBase::getLastFileId in Drupal 8
Same name in this branch
- 8 core/modules/file/src/Tests/FileFieldTestBase.php \Drupal\file\Tests\FileFieldTestBase::getLastFileId()
- 8 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/ src/ Tests/ FileFieldTestBase.php, line 62
Class
- FileFieldTestBase
- Provides methods specifically for testing File module's field handling.
Namespace
Drupal\file\TestsCode
public function getLastFileId() {
return (int) \Drupal::entityQueryAggregate('file')
->aggregate('fid', 'max')
->execute()[0]['fid_max'];
}