comparison core/modules/locale/src/SourceString.php @ 0:4c8ae668cc8c

Initial import (non-working)
author Chris Cannam
date Wed, 29 Nov 2017 16:09:58 +0000
parents
children 129ea1e6d783
comparison
equal deleted inserted replaced
-1:000000000000 0:4c8ae668cc8c
1 <?php
2
3 namespace Drupal\locale;
4
5 /**
6 * Defines the locale source string object.
7 *
8 * This class represents a module-defined string value that is to be translated.
9 * This string must at least contain a 'source' field, which is the raw source
10 * value, and is assumed to be in English language.
11 */
12 class SourceString extends StringBase {
13 /**
14 * {@inheritdoc}
15 */
16 public function isSource() {
17 return isset($this->source);
18 }
19
20 /**
21 * {@inheritdoc}
22 */
23 public function isTranslation() {
24 return FALSE;
25 }
26
27 /**
28 * {@inheritdoc}
29 */
30 public function getString() {
31 return isset($this->source) ? $this->source : '';
32 }
33
34 /**
35 * {@inheritdoc}
36 */
37 public function setString($string) {
38 $this->source = $string;
39 return $this;
40 }
41
42 /**
43 * {@inheritdoc}
44 */
45 public function isNew() {
46 return empty($this->lid);
47 }
48
49 }