You are here

public function AddToCartItem::isEmpty in Basic cart 8

Same name and namespace in other branches
  1. 8.6 src/Plugin/Field/FieldType/AddToCartItem.php \Drupal\basic_cart\Plugin\Field\FieldType\AddToCartItem::isEmpty()
  2. 8.0 src/Plugin/Field/FieldType/AddToCartItem.php \Drupal\basic_cart\Plugin\Field\FieldType\AddToCartItem::isEmpty()
  3. 8.2 src/Plugin/Field/FieldType/AddToCartItem.php \Drupal\basic_cart\Plugin\Field\FieldType\AddToCartItem::isEmpty()
  4. 8.3 src/Plugin/Field/FieldType/AddToCartItem.php \Drupal\basic_cart\Plugin\Field\FieldType\AddToCartItem::isEmpty()
  5. 8.4 src/Plugin/Field/FieldType/AddToCartItem.php \Drupal\basic_cart\Plugin\Field\FieldType\AddToCartItem::isEmpty()
  6. 8.5 src/Plugin/Field/FieldType/AddToCartItem.php \Drupal\basic_cart\Plugin\Field\FieldType\AddToCartItem::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/AddToCartItem.php, line 41

Class

AddToCartItem
Plugin implementation of the 'addtocart' field type.

Namespace

Drupal\basic_cart\Plugin\Field\FieldType

Code

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