Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. MigrateException.php

class MigrateException

Defines the migrate exception class.

Hierarchy

  • class \Drupal\migrate\MigrateException extends \Drupal\migrate\Exception

Expanded class hierarchy of MigrateException

41 files declare their use of MigrateException
ArrayBuild.php in core/modules/migrate/src/Plugin/migrate/process/ArrayBuild.php
Callback.php in core/modules/migrate/src/Plugin/migrate/process/Callback.php
Concat.php in core/modules/migrate/src/Plugin/migrate/process/Concat.php
ContentTranslationEnabledSetting.php in core/modules/language/src/Plugin/migrate/process/ContentTranslationEnabledSetting.php
ConvertTokens.php in core/modules/user/src/Plugin/migrate/process/ConvertTokens.php

... See full list

File

core/modules/migrate/src/MigrateException.php, line 11

Namespace

Drupal\migrate
View source
class MigrateException extends \Exception {
    
    /**
     * The level of the error being reported.
     *
     * The value is a MigrationInterface::MESSAGE_* constant.
     *
     * @var int
     *
     * @see \Drupal\migrate\Plugin\MigrationInterface
     */
    protected $level;
    
    /**
     * The status to record in the map table for the current item.
     *
     * The value is a MigrateIdMapInterface::STATUS_* constant.
     *
     * @var int
     *
     * @see \Drupal\migrate\Plugin\MigrateIdMapInterface
     */
    protected $status;
    
    /**
     * Constructs a MigrateException object.
     *
     * @param string $message
     *   The message for the exception.
     * @param int $code
     *   The Exception code.
     * @param \Exception $previous
     *   The previous exception used for the exception chaining.
     * @param int $level
     *   The level of the error, a Migration::MESSAGE_* constant.
     * @param int $status
     *   The status of the item for the map table, a MigrateMap::STATUS_*
     *   constant.
     */
    public function __construct($message = '', $code = 0, ?\Exception $previous = NULL, $level = MigrationInterface::MESSAGE_ERROR, $status = MigrateIdMapInterface::STATUS_FAILED) {
        $this->level = $level;
        $this->status = $status;
        parent::__construct($message);
    }
    
    /**
     * Gets the level.
     *
     * @return int
     *   An integer status code. @see Migration::MESSAGE_*
     */
    public function getLevel() {
        return $this->level;
    }
    
    /**
     * Gets the status of the current item.
     *
     * @return int
     *   An integer status code. @see MigrateMap::STATUS_*
     */
    public function getStatus() {
        return $this->status;
    }

}

Members

Title Sort descending Modifiers Object type Summary Overrides
MigrateException::$level protected property The level of the error being reported.
MigrateException::$status protected property The status to record in the map table for the current item.
MigrateException::getLevel public function Gets the level.
MigrateException::getStatus public function Gets the status of the current item.
MigrateException::__construct public function Constructs a MigrateException object. 1
RSS feed
Powered by Drupal