parent
53ab326415
commit
43455d5ae1
|
@ -11,15 +11,5 @@ services:
|
||||||
Drupal\Core\Queue\QueueFactory:
|
Drupal\Core\Queue\QueueFactory:
|
||||||
alias: queue
|
alias: queue
|
||||||
|
|
||||||
Drupal\opdavies_blog\EventSubscriber\PushPostToSocialMediaOnceItIsPublished:
|
|
||||||
autowire: true
|
|
||||||
tags:
|
|
||||||
- { name: event_subscriber }
|
|
||||||
|
|
||||||
Drupal\opdavies_blog\EventSubscriber\SortTagsAlphabeticallyWhenPostIsSaved:
|
|
||||||
autowire: true
|
|
||||||
tags:
|
|
||||||
- { name: event_subscriber }
|
|
||||||
|
|
||||||
GuzzleHttp\ClientInterface:
|
GuzzleHttp\ClientInterface:
|
||||||
alias: http_client
|
alias: http_client
|
||||||
|
|
|
@ -12,7 +12,7 @@ use Symfony\Component\Finder\Finder;
|
||||||
final class OpdaviesBlogServiceProvider implements ServiceProviderInterface {
|
final class OpdaviesBlogServiceProvider implements ServiceProviderInterface {
|
||||||
|
|
||||||
public function register(ContainerBuilder $container): void {
|
public function register(ContainerBuilder $container): void {
|
||||||
foreach (['Repository', 'Service'] as $directory) {
|
foreach (['EventSubscriber', 'Repository', 'Service'] as $directory) {
|
||||||
$files = Finder::create()
|
$files = Finder::create()
|
||||||
->in(__DIR__ . '/' . $directory)
|
->in(__DIR__ . '/' . $directory)
|
||||||
->files()
|
->files()
|
||||||
|
@ -28,6 +28,9 @@ final class OpdaviesBlogServiceProvider implements ServiceProviderInterface {
|
||||||
|
|
||||||
$definition = new Definition($class);
|
$definition = new Definition($class);
|
||||||
$definition->setAutowired(TRUE);
|
$definition->setAutowired(TRUE);
|
||||||
|
if ($directory == 'EventSubscriber') {
|
||||||
|
$definition->addTag('event_subscriber');
|
||||||
|
}
|
||||||
$container->setDefinition($class, $definition);
|
$container->setDefinition($class, $definition);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,3 @@ services:
|
||||||
|
|
||||||
Drupal\Core\Entity\EntityTypeManagerInterface:
|
Drupal\Core\Entity\EntityTypeManagerInterface:
|
||||||
alias: entity_type.manager
|
alias: entity_type.manager
|
||||||
|
|
||||||
Drupal\opdavies_talks\EventSubscriber\UpdateTalkNodeBeforeSave:
|
|
||||||
tags:
|
|
||||||
- { name: event_subscriber }
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ use Symfony\Component\Finder\Finder;
|
||||||
final class OpdaviesTalksServiceProvider implements ServiceProviderInterface {
|
final class OpdaviesTalksServiceProvider implements ServiceProviderInterface {
|
||||||
|
|
||||||
public function register(ContainerBuilder $container): void {
|
public function register(ContainerBuilder $container): void {
|
||||||
foreach (['Repository', 'Service'] as $directory) {
|
foreach (['EventSubscriber', 'Repository', 'Service'] as $directory) {
|
||||||
$files = Finder::create()
|
$files = Finder::create()
|
||||||
->in(__DIR__ . '/' . $directory)
|
->in(__DIR__ . '/' . $directory)
|
||||||
->files()
|
->files()
|
||||||
|
@ -28,6 +28,9 @@ final class OpdaviesTalksServiceProvider implements ServiceProviderInterface {
|
||||||
|
|
||||||
$definition = new Definition($class);
|
$definition = new Definition($class);
|
||||||
$definition->setAutowired(TRUE);
|
$definition->setAutowired(TRUE);
|
||||||
|
if ($directory == 'EventSubscriber') {
|
||||||
|
$definition->addTag('event_subscriber');
|
||||||
|
}
|
||||||
$container->setDefinition($class, $definition);
|
$container->setDefinition($class, $definition);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue