You are here

public function AcsfThemeNotify::addNotification in Acquia Cloud Site Factory Connector 8.2

Same name and namespace in other branches
  1. 8 src/AcsfThemeNotify.php \Drupal\acsf\AcsfThemeNotify::addNotification()

Stores a theme notification for resending later.

If the initial request to send the notification to the Factory fails, we store it and retry later on cron.

Parameters

string $event_type: The type of theme event that occurred.

string $theme: The system name of the theme the event relates to.

1 call to AcsfThemeNotify::addNotification()
AcsfThemeNotify::sendNotification in src/AcsfThemeNotify.php
Sends a theme notification to the Factory.

File

src/AcsfThemeNotify.php, line 230

Class

AcsfThemeNotify
Manages theme notifications that need to be sent to the Factory.

Namespace

Drupal\acsf

Code

public function addNotification($event_type, $theme) {
  $this->database
    ->insert('acsf_theme_notifications')
    ->fields([
    'timestamp' => time(),
    'event' => $event_type,
    'theme' => $theme,
    'attempts' => 1,
  ])
    ->execute();
}