1 | <?php |
||
32 | class Route extends FieldPluginBase implements ContainerFactoryPluginInterface { |
||
33 | |||
34 | /** |
||
35 | * The path validator service. |
||
36 | * |
||
37 | * @var \Drupal\Core\Path\PathValidatorInterface |
||
38 | */ |
||
39 | protected $pathValidator; |
||
40 | |||
41 | /** |
||
42 | * The language negotiator service. |
||
43 | * |
||
44 | * @var \Drupal\language\LanguageNegotiator |
||
45 | */ |
||
46 | protected $languageNegotiator; |
||
47 | |||
48 | /** |
||
49 | * The language manager. |
||
50 | * |
||
51 | * @var \Drupal\Core\Language\LanguageManagerInterface |
||
52 | */ |
||
53 | protected $languageManager; |
||
54 | |||
55 | /** |
||
56 | * {@inheritdoc} |
||
57 | */ |
||
58 | public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { |
||
68 | |||
69 | /** |
||
70 | * Route constructor. |
||
71 | * |
||
72 | * @param array $configuration |
||
73 | * The plugin configuration. |
||
74 | * @param string $pluginId |
||
75 | * The plugin id. |
||
76 | * @param mixed $pluginDefinition |
||
77 | * The plugin definition. |
||
78 | * @param \Drupal\Core\Path\PathValidatorInterface $pathValidator |
||
79 | * The path validator service. |
||
80 | * @param \Drupal\language\LanguageNegotiator|null $languageNegotiator |
||
81 | * The language negotiator. |
||
82 | * @param \Drupal\Core\Language\LanguageManagerInterface $languageManager |
||
83 | * The language manager. |
||
84 | */ |
||
85 | public function __construct( |
||
98 | |||
99 | /** |
||
100 | * {@inheritdoc} |
||
101 | * |
||
102 | * Execute routing in language context. |
||
103 | * |
||
104 | * Language context has to be inferred from the path prefix, but set before |
||
105 | * `resolveValues` is invoked. |
||
106 | */ |
||
107 | public function resolve($value, array $args, ResolveContext $context, ResolveInfo $info) { |
||
120 | |||
121 | /** |
||
122 | * {@inheritdoc} |
||
123 | * |
||
124 | * Route field is always language aware since it sets it's context from |
||
125 | * the prefix. |
||
126 | */ |
||
127 | protected function isLanguageAwareField() { |
||
130 | |||
131 | /** |
||
132 | * Get the redirect repository service. |
||
133 | * |
||
134 | * @return \Drupal\redirect\RedirectRepository |
||
135 | */ |
||
136 | protected function getRedirectRepository() { |
||
139 | |||
140 | /** |
||
141 | * Get the path processor. |
||
142 | * |
||
143 | * @return \Drupal\Core\PathProcessor\InboundPathProcessorInterface |
||
144 | */ |
||
145 | protected function getPathProcessor() { |
||
148 | |||
149 | /** |
||
150 | * {@inheritdoc} |
||
151 | */ |
||
152 | public function resolveValues($value, array $args, ResolveContext $context, ResolveInfo $info) { |
||
173 | |||
174 | } |
||
175 |