MigrateMessageCapture.php

Same filename in other branches
  1. 9 core/modules/migrate_drupal_ui/src/Batch/MigrateMessageCapture.php
  2. 8.9.x core/modules/migrate_drupal_ui/src/Batch/MigrateMessageCapture.php
  3. 11.x core/modules/migrate_drupal_ui/src/Batch/MigrateMessageCapture.php

Namespace

Drupal\migrate_drupal_ui\Batch

File

core/modules/migrate_drupal_ui/src/Batch/MigrateMessageCapture.php

View source
<?php

namespace Drupal\migrate_drupal_ui\Batch;

use Drupal\migrate\MigrateMessageInterface;

/**
 * Allows capturing messages rather than displaying them directly.
 */
class MigrateMessageCapture implements MigrateMessageInterface {
    
    /**
     * Array of recorded messages.
     *
     * @var array
     */
    protected $messages = [];
    
    /**
     * {@inheritdoc}
     */
    public function display($message, $type = 'status') {
        $this->messages[] = $message;
    }
    
    /**
     * Clears out any captured messages.
     */
    public function clear() {
        $this->messages = [];
    }
    
    /**
     * Returns any captured messages.
     *
     * @return array
     *   The captured messages.
     */
    public function getMessages() {
        return $this->messages;
    }

}

Classes

Title Deprecated Summary
MigrateMessageCapture Allows capturing messages rather than displaying them directly.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.