Newer
Older
Alex Pott
committed
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
<?php
/**
* @file
* Contains \Drupal\Core\TypedData\PrimitiveBase.
*/
namespace Drupal\Core\TypedData;
/**
* Base class for primitive data types.
*/
abstract class PrimitiveBase extends TypedData implements PrimitiveInterface {
/**
* The data value.
*
* @var mixed
*/
protected $value;
/**
* {@inheritdoc}
*/
public function getValue() {
return $this->value;
}
/**
* {@inheritdoc}
*/
public function setValue($value, $notify = TRUE) {
// Notify the parent of any changes to be made.
if ($notify && isset($this->parent)) {
$this->parent->onChange($this->name);
}
$this->value = $value;
}
}