public function SocialLinkItem::isEmpty in Social Link Field 8
Determines whether the data structure is empty.
Return value
bool TRUE if the data structure is empty, FALSE otherwise.
Overrides Map::isEmpty
File
- src/
Plugin/ Field/ FieldType/ SocialLinkItem.php, line 58
Class
- SocialLinkItem
- Defines the 'social_links' entity field type.
Namespace
Drupal\social_link_field\Plugin\Field\FieldTypeCode
public function isEmpty() {
$value = $this
->get('link')
->getValue();
$social = $this
->get('social')
->getValue();
// Allow to save just social without link for default value in field config.
return empty($value) && empty($social);
}