public function OrderProductStorage::save in Ubercart 8.4
Saves the entity permanently.
Parameters
\Drupal\Core\Entity\EntityInterface $entity: The entity to save.
Return value
SAVED_NEW or SAVED_UPDATED is returned depending on the operation performed.
Throws
\Drupal\Core\Entity\EntityStorageException In case of failures, an exception is thrown.
Overrides SqlContentEntityStorage::save
File
- uc_order/
src/ OrderProductStorage.php, line 16
Class
- OrderProductStorage
- Controller class for ordered products.
Namespace
Drupal\uc_orderCode
public function save(EntityInterface $product) {
// Product kits, particularly, shouldn't actually be added to an order,
// but instead they cause other products to be added.
if (isset($product->skip_save) && $product->skip_save == TRUE) {
return;
}
return parent::save($product);
}