public function StringMiconItem::isEmpty in Micon 8
Same name and namespace in other branches
- 2.x src/Plugin/Field/FieldType/StringMiconItem.php \Drupal\micon\Plugin\Field\FieldType\StringMiconItem::isEmpty()
Determines whether the data structure is empty.
Return value
bool TRUE if the data structure is empty, FALSE otherwise.
Overrides StringItemBase::isEmpty
File
- src/
Plugin/ Field/ FieldType/ StringMiconItem.php, line 31
Class
- StringMiconItem
- Plugin implementation of the 'string_micon' field type.
Namespace
Drupal\micon\Plugin\Field\FieldTypeCode
public function isEmpty() {
$value = $this
->get('value')
->getValue();
if ($value) {
$value = \Drupal::service('micon.icon.manager')
->getIconMatch($value);
}
return $value === NULL || $value === '';
}