You are here

OrderProductStorage.php in Ubercart 8.4

Namespace

Drupal\uc_order

File

uc_order/src/OrderProductStorage.php
View source
<?php

namespace Drupal\uc_order;

use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\Sql\SqlContentEntityStorage;

/**
 * Controller class for ordered products.
 */
class OrderProductStorage extends SqlContentEntityStorage {

  /**
   * {@inheritdoc}
   */
  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);
  }

}

Classes

Namesort descending Description
OrderProductStorage Controller class for ordered products.