You are here

UserMergePropertyBase.php in User Merge 2.x

File

src/Plugin/UserMerge/Property/UserMergePropertyBase.php
View source
<?php

namespace Drupal\usermerge\Plugin\UserMerge\Property;

use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\usermerge\Plugin\UserMergePropertyPluginInterface;
use Drupal\Component\Plugin\PluginBase;
use Symfony\Component\DependencyInjection\ContainerInterface;

/**
 * Class UserMergePropertyBase.
 *
 * @package Drupal\usermerge\Plugin\UserMerge\Property
 */
abstract class UserMergePropertyBase extends PluginBase implements UserMergePropertyPluginInterface {

  /**
   * Entity type manager.
   *
   * @var \Drupal\Core\Entity\EntityTypeManagerInterface
   */
  protected $entityTypeManager;

  /**
   * PropertyComment constructor.
   *
   * @param array $configuration
   *   A configuration array containing information about the plugin instance.
   * @param string $plugin_id
   *   The plugin_id for the plugin instance.
   * @param mixed $plugin_definition
   *   The plugin implementation definition.
   * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
   *   The entity type manager.
   */
  public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityTypeManagerInterface $entity_type_manager) {
    parent::__construct($configuration, $plugin_id, $plugin_definition);
    $this->entityTypeManager = $entity_type_manager;
  }

  /**
   * {@inheritdoc}
   */
  public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
    return new static($configuration, $plugin_id, $plugin_definition, $container
      ->get('entity_type.manager'));
  }

  /**
   * {@inheritdoc}
   */
  public function getName() {
    return $this->pluginDefinition['name'];
  }

  /**
   * {@inheritdoc}
   */
  public function getReviewForm() {
    return $this
      ->getPluginDefinition()['review'];
  }

}

Classes

Namesort descending Description
UserMergePropertyBase Class UserMergePropertyBase.