public function ProductAttributeFieldManagerInterface::canDeleteField in Commerce Core 8.2
Checks whether the attribute field for the given attribute can be deleted.
An attribute field is no longer deletable once it has data.
Parameters
\Drupal\commerce_product\Entity\ProductAttributeInterface $attribute: The product attribute.
string $variation_type_id: The product variation type ID.
Return value
bool TRUE if the attribute field can be deleted, FALSE otherwise.
Throws
\InvalidArgumentException Thrown when the attribute field does not exist.
1 method overrides ProductAttributeFieldManagerInterface::canDeleteField()
- ProductAttributeFieldManager::canDeleteField in modules/
product/ src/ ProductAttributeFieldManager.php - Checks whether the attribute field for the given attribute can be deleted.
File
- modules/
product/ src/ ProductAttributeFieldManagerInterface.php, line 78
Class
- ProductAttributeFieldManagerInterface
- Manages attribute fields.
Namespace
Drupal\commerce_productCode
public function canDeleteField(ProductAttributeInterface $attribute, $variation_type_id);