comparison core/modules/language/src/LanguageNegotiationMethodBase.php @ 0:4c8ae668cc8c

Initial import (non-working)
author Chris Cannam
date Wed, 29 Nov 2017 16:09:58 +0000
parents
children 7a779792577d
comparison
equal deleted inserted replaced
-1:000000000000 0:4c8ae668cc8c
1 <?php
2
3 namespace Drupal\language;
4
5 use Drupal\Core\Config\ConfigFactoryInterface;
6 use Drupal\Core\Language\LanguageInterface;
7 use Drupal\Core\Session\AccountInterface;
8
9 /**
10 * Base class for language negotiation methods.
11 */
12 abstract class LanguageNegotiationMethodBase implements LanguageNegotiationMethodInterface {
13
14 /**
15 * The language manager.
16 *
17 * @var \Drupal\Core\Language\LanguageManagerInterface
18 */
19 protected $languageManager;
20
21 /**
22 * The configuration factory.
23 *
24 * @var \Drupal\Core\Config\ConfigFactoryInterface
25 */
26 protected $config;
27
28 /**
29 * The current active user.
30 *
31 * @return \Drupal\Core\Session\AccountInterface
32 */
33 protected $currentUser;
34
35 /**
36 * {@inheritdoc}
37 */
38 public function setLanguageManager(ConfigurableLanguageManagerInterface $language_manager) {
39 $this->languageManager = $language_manager;
40 }
41
42 /**
43 * {@inheritdoc}
44 */
45 public function setConfig(ConfigFactoryInterface $config) {
46 $this->config = $config;
47 }
48
49 /**
50 * {@inheritdoc}
51 */
52 public function setCurrentUser(AccountInterface $current_user) {
53 $this->currentUser = $current_user;
54 }
55
56 /**
57 * {@inheritdoc}
58 */
59 public function persist(LanguageInterface $language) {
60 // Default implementation persists nothing.
61 }
62
63 }