public function FivestarItem::isEmpty in Fivestar 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/ FivestarItem.php, line 228
Class
- FivestarItem
- Plugin implementation of the 'fivestar' field type.
Namespace
Drupal\fivestar\Plugin\Field\FieldTypeCode
public function isEmpty() {
$rating = $this
->get('rating')
->getValue();
return empty($rating) || $rating == '-';
}