You are here

class MigrateMessageCapture in Migrate Upgrade 8

Allows capturing messages rather than displaying them directly.

Hierarchy

Expanded class hierarchy of MigrateMessageCapture

File

src/MigrateMessageCapture.php, line 15
Contains \Drupal\migrate_upgrade\MigrateMessageCapture.

Namespace

Drupal\migrate_upgrade
View source
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;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
MigrateMessageCapture::$messages protected property Array of recorded messages.
MigrateMessageCapture::clear public function Clears out any captured messages.
MigrateMessageCapture::display public function Displays a migrate message. Overrides MigrateMessageInterface::display
MigrateMessageCapture::getMessages public function Returns any captured messages.