EmailFrequencyBase.php in Open Social 8.3
Same filename and directory in other branches
- 8.9 modules/custom/activity_send/modules/activity_send_email/src/EmailFrequencyBase.php
- 8 modules/custom/activity_send/modules/activity_send_email/src/EmailFrequencyBase.php
- 8.2 modules/custom/activity_send/modules/activity_send_email/src/EmailFrequencyBase.php
- 8.4 modules/custom/activity_send/modules/activity_send_email/src/EmailFrequencyBase.php
- 8.5 modules/custom/activity_send/modules/activity_send_email/src/EmailFrequencyBase.php
- 8.6 modules/custom/activity_send/modules/activity_send_email/src/EmailFrequencyBase.php
- 8.7 modules/custom/activity_send/modules/activity_send_email/src/EmailFrequencyBase.php
- 8.8 modules/custom/activity_send/modules/activity_send_email/src/EmailFrequencyBase.php
- 10.3.x modules/custom/activity_send/modules/activity_send_email/src/EmailFrequencyBase.php
- 10.0.x modules/custom/activity_send/modules/activity_send_email/src/EmailFrequencyBase.php
- 10.1.x modules/custom/activity_send/modules/activity_send_email/src/EmailFrequencyBase.php
- 10.2.x modules/custom/activity_send/modules/activity_send_email/src/EmailFrequencyBase.php
Namespace
Drupal\activity_send_emailFile
modules/custom/activity_send/modules/activity_send_email/src/EmailFrequencyBase.phpView source
<?php
namespace Drupal\activity_send_email;
use Drupal\activity_creator\Entity\Activity;
use Drupal\Component\Plugin\PluginBase;
use Drupal\Core\Database\Database;
use Drupal\message\Entity\Message;
use Drupal\user\Entity\User;
/**
* Class EmailFrequencyBase.
*
* Implements common functions for all EmailFrequency classes.
*/
class EmailFrequencyBase extends PluginBase implements EmailFrequencyInterface {
/**
* {@inheritdoc}
*/
public function getName() {
return $this->pluginDefinition['name'];
}
/**
* {@inheritdoc}
*/
public function getWeight() {
return $this->pluginDefinition['weight'];
}
/**
* {@inheritdoc}
*/
public function getInterval() {
return $this->pluginDefinition['interval'];
}
/**
* {@inheritdoc}
*/
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();
}
}
Classes
Name | Description |
---|---|
EmailFrequencyBase | Class EmailFrequencyBase. |