You are here

public function EmailFrequencyBase::processItem in Open Social 8.9

Same name and namespace in other branches
  1. 8 modules/custom/activity_send/modules/activity_send_email/src/EmailFrequencyBase.php \Drupal\activity_send_email\EmailFrequencyBase::processItem()
  2. 8.2 modules/custom/activity_send/modules/activity_send_email/src/EmailFrequencyBase.php \Drupal\activity_send_email\EmailFrequencyBase::processItem()
  3. 8.3 modules/custom/activity_send/modules/activity_send_email/src/EmailFrequencyBase.php \Drupal\activity_send_email\EmailFrequencyBase::processItem()
  4. 8.4 modules/custom/activity_send/modules/activity_send_email/src/EmailFrequencyBase.php \Drupal\activity_send_email\EmailFrequencyBase::processItem()
  5. 8.5 modules/custom/activity_send/modules/activity_send_email/src/EmailFrequencyBase.php \Drupal\activity_send_email\EmailFrequencyBase::processItem()
  6. 8.6 modules/custom/activity_send/modules/activity_send_email/src/EmailFrequencyBase.php \Drupal\activity_send_email\EmailFrequencyBase::processItem()
  7. 8.7 modules/custom/activity_send/modules/activity_send_email/src/EmailFrequencyBase.php \Drupal\activity_send_email\EmailFrequencyBase::processItem()
  8. 8.8 modules/custom/activity_send/modules/activity_send_email/src/EmailFrequencyBase.php \Drupal\activity_send_email\EmailFrequencyBase::processItem()
  9. 10.3.x modules/custom/activity_send/modules/activity_send_email/src/EmailFrequencyBase.php \Drupal\activity_send_email\EmailFrequencyBase::processItem()
  10. 10.0.x modules/custom/activity_send/modules/activity_send_email/src/EmailFrequencyBase.php \Drupal\activity_send_email\EmailFrequencyBase::processItem()
  11. 10.1.x modules/custom/activity_send/modules/activity_send_email/src/EmailFrequencyBase.php \Drupal\activity_send_email\EmailFrequencyBase::processItem()
  12. 10.2.x modules/custom/activity_send/modules/activity_send_email/src/EmailFrequencyBase.php \Drupal\activity_send_email\EmailFrequencyBase::processItem()

Processes an activity item.

Parameters

\Drupal\activity_creator\Entity\Activity $activity: The Activity object.

\Drupal\message\Entity\Message $message: The Message object.

\Drupal\user\Entity\User $target: The target user account.

Overrides EmailFrequencyInterface::processItem

2 methods override EmailFrequencyBase::processItem()
Immediately::processItem in modules/custom/activity_send/modules/activity_send_email/src/Plugin/EmailFrequency/Immediately.php
Processes an activity item.
None::processItem in modules/custom/activity_send/modules/activity_send_email/src/Plugin/EmailFrequency/None.php
Processes an activity item.

File

modules/custom/activity_send/modules/activity_send_email/src/EmailFrequencyBase.php, line 42

Class

EmailFrequencyBase
Class EmailFrequencyBase.

Namespace

Drupal\activity_send_email

Code

public function processItem(Activity $activity, Message $message, User $target) {
  $db = Database::getConnection();

  // Insert incoming activities in our digest table.
  $db
    ->insert('user_activity_digest')
    ->fields([
    'uid',
    'activity',
    'frequency',
    'timestamp',
  ])
    ->values([
    $target
      ->id(),
    $activity
      ->id(),
    $this->pluginId,
    time(),
  ])
    ->execute();
}