summaryrefslogtreecommitdiffstats
path: root/core/lib/Drupal/Core/TypedData/TypedData.php
diff options
context:
space:
mode:
authorAlex Pott2013-06-19 08:31:20 (GMT)
committerAlex Pott2013-06-19 08:31:20 (GMT)
commit851d7d0ff2c91a2e4595a2fcdc460952476db163 (patch)
treea27f82e938f5823466ebb5de920ce485321bca68 /core/lib/Drupal/Core/TypedData/TypedData.php
parent3f196cab2ed627676e29b02fc4fe2e613eb6144a (diff)
Issue #1777956 by fago, klausi, sun, dasjo: Provide a way to define default values for entity fields.
Diffstat (limited to 'core/lib/Drupal/Core/TypedData/TypedData.php')
-rw-r--r--core/lib/Drupal/Core/TypedData/TypedData.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/core/lib/Drupal/Core/TypedData/TypedData.php b/core/lib/Drupal/Core/TypedData/TypedData.php
index 62fb8d9..8bfa215 100644
--- a/core/lib/Drupal/Core/TypedData/TypedData.php
+++ b/core/lib/Drupal/Core/TypedData/TypedData.php
@@ -128,6 +128,15 @@ abstract class TypedData implements TypedDataInterface, PluginInspectionInterfac
}
/**
+ * {@inheritdoc}
+ */
+ public function applyDefaultValue($notify = TRUE) {
+ // Default to no default value.
+ $this->setValue(NULL, $notify);
+ return $this;
+ }
+
+ /**
* Implements \Drupal\Core\TypedData\TypedDataInterface::setContext().
*/
public function setContext($name = NULL, TypedDataInterface $parent = NULL) {