public function WebformScheduledEmailManager::load in Webform 6.x
Same name and namespace in other branches
- 8.5 modules/webform_scheduled_email/src/WebformScheduledEmailManager.php \Drupal\webform_scheduled_email\WebformScheduledEmailManager::load()
Load scheduled email for specified submission and handler.
Parameters
\Drupal\webform\WebformSubmissionInterface $webform_submission: A webform submission.
string $handler_id: The webform handler ID.
Return value
\stdClass|null The scheduled email record or NULL
Overrides WebformScheduledEmailManagerInterface::load
2 calls to WebformScheduledEmailManager::load()
- WebformScheduledEmailManager::hasScheduledEmail in modules/
webform_scheduled_email/ src/ WebformScheduledEmailManager.php - Determine if submission has scheduled email for specified handler.
- WebformScheduledEmailManager::schedule in modules/
webform_scheduled_email/ src/ WebformScheduledEmailManager.php - Scheduled an email to be send at a later date.
File
- modules/
webform_scheduled_email/ src/ WebformScheduledEmailManager.php, line 152
Class
- WebformScheduledEmailManager
- Defines the webform scheduled email manager.
Namespace
Drupal\webform_scheduled_emailCode
public function load(WebformSubmissionInterface $webform_submission, $handler_id) {
$query = $this->database
->select('webform_scheduled_email', 'w')
->fields('w', [
'eid',
'webform_id',
'sid',
'entity_type',
'entity_id',
'handler_id',
'state',
'send',
]);
$this
->addQueryConditions($query, $webform_submission
->getWebform(), $webform_submission, $webform_submission
->getSourceEntity(), $handler_id);
return $query
->execute()
->fetchObject();
}