You are here

protected function ActivityFactory::getFieldDestinations in Open Social 8.3

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

Get field value for 'destination' field from data array.

2 calls to ActivityFactory::getFieldDestinations()
ActivityFactory::buildActivities in modules/custom/activity_creator/src/ActivityFactory.php
Build the activities based on a data array.
ActivityFactory::buildAggregatedActivites in modules/custom/activity_creator/src/ActivityFactory.php
Build the aggregated activities based on a data array.

File

modules/custom/activity_creator/src/ActivityFactory.php, line 94

Class

ActivityFactory
Class ActivityFactory to create Activity items based on ActivityLogs.

Namespace

Drupal\activity_creator

Code

protected function getFieldDestinations(array $data, $allowed_destinations = []) {
  $value = NULL;
  if (isset($data['destination'])) {
    $value = $data['destination'];
    if (!empty($allowed_destinations)) {
      foreach ($value as $key => $destination) {
        if (!in_array($destination['value'], $allowed_destinations)) {
          unset($value[$key]);
        }
      }
    }
  }
  return $value;
}