function BaseFieldDefinition::getPropertyDefinition
Gets the definition of a contained property.
Parameters
string $name: The name of property.
Return value
\Drupal\Core\TypedData\DataDefinitionInterface|null The definition of the property or NULL if the property does not exist.
Overrides FieldStorageDefinitionInterface::getPropertyDefinition
File
-
core/
lib/ Drupal/ Core/ Field/ BaseFieldDefinition.php, line 576
Class
- BaseFieldDefinition
- A class for defining entity fields.
Namespace
Drupal\Core\FieldCode
public function getPropertyDefinition($name) {
if (!is_string($name)) {
@trigger_error('Calling ' . __CLASS__ . '::getPropertyDefinition() with a non-string $name is deprecated in drupal:11.3.0 and throws an exception in drupal:12.0.0. See https://www.drupal.org/node/3557373', E_USER_DEPRECATED);
}
if (!isset($this->propertyDefinitions)) {
$this->getPropertyDefinitions();
}
if (isset($this->propertyDefinitions[$name])) {
return $this->propertyDefinitions[$name];
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.