You are here

public function StarRatingItem::isEmpty in Star Rating 8.2

Same name and namespace in other branches
  1. 8.4 src/Plugin/Field/FieldType/StarRatingItem.php \Drupal\starrating\Plugin\Field\FieldType\StarRatingItem::isEmpty()
  2. 8 src/Plugin/Field/FieldType/StarRatingItem.php \Drupal\starrating\Plugin\Field\FieldType\StarRatingItem::isEmpty()
  3. 8.3 src/Plugin/Field/FieldType/StarRatingItem.php \Drupal\starrating\Plugin\Field\FieldType\StarRatingItem::isEmpty()

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/StarRatingItem.php, line 55

Class

StarRatingItem
Plugin implementation of the 'addtocart' field type.

Namespace

Drupal\starrating\Plugin\Field\FieldType

Code

public function isEmpty() {
  $value = $this
    ->get('value')
    ->getValue();
  return $value === NULL || $value === '';
}