protected function PdfWebformPopulationTest::getLastSubmissionId in FillPDF 8.4
Same name and namespace in other branches
- 5.0.x tests/src/Functional/PdfWebformPopulationTest.php \Drupal\Tests\fillpdf\Functional\PdfWebformPopulationTest::getLastSubmissionId()
Get the last submission id.
Parameters
\Drupal\webform\WebformInterface $webform: A webform.
Return value
int The last submission id.
1 call to PdfWebformPopulationTest::getLastSubmissionId()
- PdfWebformPopulationTest::setUp in tests/
src/ Functional/ PdfWebformPopulationTest.php
File
- tests/
src/ Functional/ PdfWebformPopulationTest.php, line 144
Class
- PdfWebformPopulationTest
- Tests Webform population and image stamping.
Namespace
Drupal\Tests\fillpdf\FunctionalCode
protected function getLastSubmissionId(WebformInterface $webform) {
// Get submission sid.
$url = UrlHelper::parse($this
->getUrl());
if (isset($url['query']['sid'])) {
return $url['query']['sid'];
}
$entity_ids = $this->container
->get('entity_type.manager')
->getStorage('webform_submission')
->getQuery()
->sort('sid', 'DESC')
->condition('webform_id', $webform
->id())
->execute();
return reset($entity_ids);
}