public ContentEntityBase::hasField($field_name)
Determines whether the entity has a field with the given name.
string $field_name: The field name.
bool TRUE if the entity has a field with the given name. FALSE otherwise.
Overrides FieldableEntityInterface::hasField
public function hasField($field_name) { return (bool) $this->getFieldDefinition($field_name); }
© 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!Entity!ContentEntityBase.php/function/ContentEntityBase::hasField/8.1.x