Issue #2202401 by Berdir: Make getPropertyDefinition() return NULL instead of FALSE.

8.0.x
Alex Pott 2014-04-08 10:08:56 +01:00
parent b0fb47f327
commit ea8bca51a0
3 changed files with 4 additions and 10 deletions

View File

@ -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;
}
}
/**

View File

@ -478,9 +478,6 @@ abstract class ContentEntityBase extends Entity implements \IteratorAggregate, C
if (isset($this->fieldDefinitions[$name])) {
return $this->fieldDefinitions[$name];
}
else {
return FALSE;
}
}
/**

View File

@ -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);