Resolve #3519842 "Support oop hooks"
2 unresolved threads
Closes #3519842
Merge request reports
Activity
47 * {@inheritdoc} 43 * Constructs a EntityHooks object. 44 * 45 * @param \Drupal\Core\Config\ConfigFactoryInterface $configFactory 46 * The config factory service. 47 * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entityTypeManager 48 * The entity type manager service. 49 * @param \Drupal\Core\Session\AccountInterface $currentUser 50 * The current user. 48 51 */ 49 public static function create(ContainerInterface $container): EntityTypeInfo { 50 return new static( 51 $container->get('current_user'), 52 $container->get('config.factory') 53 ); 52 public function __construct(ConfigFactoryInterface $configFactory, EntityTypeManagerInterface $entityTypeManager, AccountInterface $currentUser) { 68 foreach ($entityTypes as $entityTypeId => $entityType) { 69 if (in_array($entityTypeId, $enabledEntityTypes, TRUE)) { 70 $entityType->setLinkTemplate('entity-logger', "/entity_logger/$entityTypeId/{{$entityTypeId}}"); 70 71 } 71 72 } 72 73 } 73 74 } 74 75 75 76 /** 76 * Add entity operation on entities that supports it. 77 * Implements hook_entity_predelete(). 78 * 79 * @param \Drupal\Core\Entity\EntityInterface $entity 80 * The given entity. 81 * 82 * @return void
Please register or sign in to reply