public function MapDataDefinition::setPropertyDefinition

public MapDataDefinition::setPropertyDefinition($name, DataDefinitionInterface $definition = NULL)

Sets the definition of a map property.

Parameters

string $name: The name of the property to define.

\Drupal\Core\TypedData\DataDefinitionInterface|null $definition: (optional) The property definition to set, or NULL to unset it.

Return value

$this

File

core/lib/Drupal/Core/TypedData/MapDataDefinition.php, line 57

Class

MapDataDefinition
A typed data definition class for defining maps.

Namespace

Drupal\Core\TypedData

Code

public function setPropertyDefinition($name, DataDefinitionInterface $definition = NULL) {
  if (isset($definition)) {
    $this->propertyDefinitions[$name] = $definition;
  }
  else {
    unset($this->propertyDefinitions[$name]);
  }
  return $this;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!TypedData!MapDataDefinition.php/function/MapDataDefinition::setPropertyDefinition/8.1.x