summaryrefslogtreecommitdiffstats
path: root/core/lib/Drupal/Core/TypedData/DataDefinition.php
diff options
context:
space:
mode:
authorwebchick2014-04-08 13:57:58 -0700
committerwebchick2014-04-08 13:57:58 -0700
commit83bdbd50dd9a107d962f33fab79fe55c392c354f (patch)
tree1924ebda48e55e42348ca4fb7a9c4d463ac6a2fd /core/lib/Drupal/Core/TypedData/DataDefinition.php
parentfc6b814e0299909612b4d835885e3c215962ec45 (diff)
Issue #2235125 by tstoeckler: Use DataDefinition::addConstraint() instead of ::setConstraints().
Diffstat (limited to 'core/lib/Drupal/Core/TypedData/DataDefinition.php')
-rw-r--r--core/lib/Drupal/Core/TypedData/DataDefinition.php12
1 files changed, 8 insertions, 4 deletions
diff --git a/core/lib/Drupal/Core/TypedData/DataDefinition.php b/core/lib/Drupal/Core/TypedData/DataDefinition.php
index 9d036a2..937f243 100644
--- a/core/lib/Drupal/Core/TypedData/DataDefinition.php
+++ b/core/lib/Drupal/Core/TypedData/DataDefinition.php
@@ -275,13 +275,17 @@ class DataDefinition implements DataDefinitionInterface, \ArrayAccess {
/**
* Sets the array of validation constraints.
*
- * See \Drupal\Core\TypedData\TypedDataManager::getConstraints() for details.
+ * NOTE: This will override any previously set constraints. In most cases
+ * DataDefinition::addConstraint() should be used instead.
*
* @param array $constraints
- * The array of constraints.
+ * The array of constraints. See
+ * \Drupal\Core\TypedData\TypedDataManager::getConstraints() for details.
*
- * @return static
- * The object itself for chaining.
+ * @return $this
+ *
+ * @see \Drupal\Core\TypedData\DataDefinition::addConstraint()
+ * @see \Drupal\Core\TypedData\DataDefinition::getConstraints()
*/
public function setConstraints(array $constraints) {
$this->definition['constraints'] = $constraints;