diff --git a/rng.module b/rng.module index 415e9b1..4de8f24 100644 --- a/rng.module +++ b/rng.module @@ -3,19 +3,10 @@ use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Session\AccountInterface; -use Drupal\Core\Access\AccessResult; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Url; -use Drupal\courier\ChannelInterface; -use Drupal\courier\TemplateCollectionInterface; use Drupal\rng\Entity\RuleSchedule; -use Drupal\rng\Entity\Registrant; use Drupal\rng\EventTypeInterface; -use Drupal\rng\Exception\InvalidEventException; -use Drupal\courier\Entity\TemplateCollection; -use Drupal\rng\RuleInterface; -use Drupal\rng\RuleComponentInterface; -use Drupal\rng\Plugin\Action\CourierTemplateCollection; use Drupal\Core\Render\Element; /** @@ -109,7 +100,7 @@ function rng_entity_operation(EntityInterface $entity) { * Implements hook_entity_insert(). */ function rng_entity_insert(EntityInterface $entity) { - /** @var \Drupal\rng\RngModel $rng_model */ + /** @var \Drupal\rng\RngEntityModel $rng_model */ $rng_model = \Drupal::service('rng.entity.model'); $rng_model->hook_entity_postsave($entity); } @@ -118,7 +109,7 @@ function rng_entity_insert(EntityInterface $entity) { * Implements hook_entity_update(). */ function rng_entity_update(EntityInterface $entity) { - /** @var \Drupal\rng\RngModel $rng_model */ + /** @var \Drupal\rng\RngEntityModel $rng_model */ $rng_model = \Drupal::service('rng.entity.model'); $rng_model->hook_entity_postsave($entity); } @@ -127,7 +118,7 @@ function rng_entity_update(EntityInterface $entity) { * Implements hook_entity_predelete(). */ function rng_entity_predelete(EntityInterface $entity) { - /** @var \Drupal\rng\RngModel $rng_model */ + /** @var \Drupal\rng\RngEntityModel $rng_model */ $rng_model = \Drupal::service('rng.entity.model'); $rng_model->hook_entity_predelete($entity); } diff --git a/rng.services.yml b/rng.services.yml index 598273d..b75b3ab 100644 --- a/rng.services.yml +++ b/rng.services.yml @@ -10,8 +10,8 @@ services: class: Drupal\rng\RngEntityAccess arguments: ['@rng.event_manager'] rng.entity.model: - class: Drupal\rng\RngModel - arguments: ['@rng.event_manager', '@plugin.manager.identity_channel'] + class: Drupal\rng\RngEntityModel + arguments: ['@entity_type.manager', '@rng.event_manager', '@plugin.manager.identity_channel'] rng.registrant.factory: class: Drupal\rng\RegistrantFactory arguments: ['@entity_type.manager', '@rng.event_manager'] diff --git a/src/RngModel.php b/src/RngEntityModel.php similarity index 98% rename from src/RngModel.php rename to src/RngEntityModel.php index d6a2235..c5fe427 100644 --- a/src/RngModel.php +++ b/src/RngEntityModel.php @@ -4,14 +4,14 @@ use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; -use Drupal\courier\Service\IdentityChannelManagerInterface; use Drupal\rng\Entity\Registrant; use Drupal\rng\Plugin\Action\CourierTemplateCollection; +use Drupal\courier\Service\IdentityChannelManagerInterface; /** * Enforces RNG model relationships. */ -class RngModel { +class RngEntityModel { /** * Storage for registration entities. @@ -56,7 +56,7 @@ class RngModel { protected $identityChannelManager; /** - * Constructs a new RegistrantFactory object. + * Constructs a new RngEntityModel object. * * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager * The entity type manager.