Issue #2202401 by Berdir: Make getPropertyDefinition() return NULL instead of FALSE.
parent
b0fb47f327
commit
ea8bca51a0
|
@ -103,16 +103,13 @@ class Mapping extends ArrayElement implements ComplexDataInterface {
|
|||
* @param string $name
|
||||
* The name of property.
|
||||
*
|
||||
* @return array|FALSE
|
||||
* The definition of the property or FALSE if the property does not exist.
|
||||
* @return array|null
|
||||
* The definition of the property or NULL if the property does not exist.
|
||||
*/
|
||||
public function getPropertyDefinition($name) {
|
||||
if (isset($this->definition['mapping'][$name])) {
|
||||
return $this->definition['mapping'][$name];
|
||||
}
|
||||
else {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -478,9 +478,6 @@ abstract class ContentEntityBase extends Entity implements \IteratorAggregate, C
|
|||
if (isset($this->fieldDefinitions[$name])) {
|
||||
return $this->fieldDefinitions[$name];
|
||||
}
|
||||
else {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -109,8 +109,8 @@ interface ContentEntityInterface extends EntityInterface, RevisionableInterface,
|
|||
* @param string $name
|
||||
* The name of the field.
|
||||
*
|
||||
* @return \Drupal\Core\Field\FieldDefinitionInterface|false
|
||||
* The definition of the field or FALSE if the field does not exist.
|
||||
* @return \Drupal\Core\Field\FieldDefinitionInterface|null
|
||||
* The definition of the field or null if the field does not exist.
|
||||
*/
|
||||
public function getFieldDefinition($name);
|
||||
|
||||
|
|
Loading…
Reference in New Issue