MigrateValidatableEntityInterface.php

Same filename in other branches
  1. 9 core/modules/migrate/src/Plugin/MigrateValidatableEntityInterface.php
  2. 8.9.x core/modules/migrate/src/Plugin/MigrateValidatableEntityInterface.php
  3. 11.x core/modules/migrate/src/Plugin/MigrateValidatableEntityInterface.php

Namespace

Drupal\migrate\Plugin

File

core/modules/migrate/src/Plugin/MigrateValidatableEntityInterface.php

View source
<?php

namespace Drupal\migrate\Plugin;

use Drupal\Core\Entity\FieldableEntityInterface;

/**
 * To implement by a destination plugin that should provide entity validation.
 *
 * @ingroup migration
 */
interface MigrateValidatableEntityInterface {
    
    /**
     * Returns a state of whether an entity needs to be validated before saving.
     *
     * @param \Drupal\Core\Entity\FieldableEntityInterface $entity
     *   The entity to check for required validation.
     *
     * @return bool
     *   A state of whether an entity needs to be validated.
     */
    public function isEntityValidationRequired(FieldableEntityInterface $entity);
    
    /**
     * Validates the entity.
     *
     * @param \Drupal\Core\Entity\FieldableEntityInterface $entity
     *   The entity to validate.
     *
     * @throws \Drupal\migrate\Exception\EntityValidationException
     *   When the validation didn't succeed.
     */
    public function validateEntity(FieldableEntityInterface $entity);

}

Interfaces

Title Deprecated Summary
MigrateValidatableEntityInterface To implement by a destination plugin that should provide entity validation.

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