Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php
/**
* @file
* Contains \Drupal\forum\Breadcrumb\ForumBreadcrumbBuilderBase.
*/
namespace Drupal\forum\Breadcrumb;
use Drupal\Core\Breadcrumb\BreadcrumbBuilderBase;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Entity\EntityManagerInterface;
use Drupal\forum\ForumManagerInterface;
/**
* Provides a forum breadcrumb base class.
*
* This just holds the dependency-injected config, entity manager, and forum
* manager objects.
*/
abstract class ForumBreadcrumbBuilderBase extends BreadcrumbBuilderBase {
/**
* Configuration object for this builder.
*
* @var \Drupal\Core\Config\Config
*/
protected $config;
/**
* The entity manager.
*
* @var \Drupal\Core\Entity\EntityManagerInterface
*/
protected $entityManager;
/**
* The forum manager service.
*
* @var \Drupal\forum\ForumManagerInterface
*/
protected $forumManager;
/**
* Constructs a forum breadcrumb builder object.
*
* @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
* The entity manager.
* @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
* The configuration factory.
* @param \Drupal\forum\ForumManagerInterface $forum_manager
* The forum manager service.
*/
public function __construct(EntityManagerInterface $entity_manager, ConfigFactoryInterface $config_factory, ForumManagerInterface $forum_manager) {
$this->entityManager = $entity_manager;
$this->config = $config_factory->get('forum.settings');
$this->forumManager = $forum_manager;
}
/**
* {@inheritdoc}
*/
public function build(array $attributes) {
$breadcrumb[] = $this->l($this->t('Home'), '<front>');
$vocabulary = $this->entityManager
catch
committed
->getStorage('taxonomy_vocabulary')