modules/acm_sku/src/StockManager.php
public function removeStockEntry(string $sku) {
    if (empty($sku)) {
      return;
    }

    // Confirm SKU is not available in any language.
    $query = $this->connection->select('acm_sku_field_data', 'sku');
    $query->condition('sku', $sku);
    $query->addField('sku', 'sku');
    $result = $query->execute()->fetchAssoc();

    if (!empty($result)) {
      return;
    }

    // Remove stock only after SKU is removed in all the languages.
    $this->connection->delete('acm_sku_stock')
      ->condition('sku', $sku)
      ->execute();
  }
public function removeStockEntry(string $sku) {
    if (empty($sku)) {
      return;
    }

    // Confirm SKU is not available in any language.
    $query = $this->connection->select('acm_sku_field_data', 'sku');
    $query->condition('sku', $sku);
    $query->addField('sku', 'sku');
    $result = $query->execute()->fetchAssoc();

    if (!empty($result)) {
      return;
    }

    // Remove stock only after SKU is removed in all the languages.
    $this->connection->delete('acm_sku_stock')
      ->condition('sku', $sku)
      ->execute();
  }
public function removeStockEntry ( string $ sku ) { if ( empty ( $ sku ) ) { return ; } // Confirm SKU is not available in any language. $ query = $ this -> connection -> select ( 'acm_sku_field_data' , 'sku' ) ; $ query -> condition ( 'sku' , $ sku ) ; $ query -> addField ( 'sku' , 'sku' ) ; $ result = $ query -> execute ( ) -> fetchAssoc ( ) ; if ( ! empty ( $ result ) ) { return ; } // Remove stock only after SKU is removed in all the languages. $ this -> connection -> delete ( 'acm_sku_stock' ) -> condition ( 'sku' , $ sku ) -> execute ( ) ; }
Remove stock entry.

@param string $sku
SKU for which stock entry needs to be removed.
Remove stock entry .