You are here

protected function ActivityFactory::getFieldOutputText in Open Social 8.7

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

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

2 calls to ActivityFactory::getFieldOutputText()
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 138

Class

ActivityFactory
Class ActivityFactory to create Activity items based on ActivityLogs.

Namespace

Drupal\activity_creator

Code

protected function getFieldOutputText(Message $message, $arguments = []) {
  $value = NULL;
  if (isset($message)) {
    $value = $this
      ->getMessageText($message);

    // Text for aggregated activities.
    if (!empty($value[1]) && !empty($arguments)) {
      $text = str_replace('@count', $arguments['@count'], $value[1]);
    }
    else {
      $text = $value[0];
    }

    // Add format.
    $value = [
      '0' => [
        'value' => $text,
        'format' => 'basic_html',
      ],
    ];
  }
  return $value;
}