Remove stock entry.

@param string $sku
SKU for which stock entry needs to be removed.
490966
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();
  }
606619
function removeThis()
    {
        $itemOptionList = eZProductCollectionItemOption::fetchList( $this->attribute( 'id' ) );

        $db = eZDB::instance();
        $db->begin();
        foreach( $itemOptionList as $itemOption )
        {
            $itemOption->remove();
        }
        $this->remove();
        $db->commit();
    }
716429
public function remove($item)
    {
        $renumberKeys = false;
        foreach ($this->items as $key => $value) {
            if ($item === $value) {
                $renumberKeys = true;
                unset($this->items[$key]);
            }
        }
        if ($renumberKeys) {
            $this->items = array_values($this->items);
        }
    }
54581
public function tearDown($serial)
    {

        // load the registry processor
        $registryProcessor = $this->getRegistryProcessor();

        // update the status
        $registryProcessor->mergeAttributesRecursive(
            $serial,
            array(
                RegistryKeys::SKU_ENTITY_ID_MAPPING => $this->skuEntityIdMapping,
                RegistryKeys::SKU_STORE_VIEW_CODE_MAPPING => $this->skuStoreViewCodeMapping
            )
        );

        // invoke the parent method
        parent::tearDown($serial);
    }
265980
public function removeItem($item)
    {
        $key = $this->getKey($item);
        if ($key !== false) {
            $this->offsetUnset($key);
        }
    }
190997
public function tearDown($serial)
    {

        // load the registry processor
        $registryProcessor = $this->getRegistryProcessor();

        // update the status up the actual import with SKU => row ID mapping
        $registryProcessor->mergeAttributesRecursive($serial, array(RegistryKeys::SKU_ROW_ID_MAPPING => $this->skuRowIdMapping));

        // call parent method
        parent::tearDown($serial);
    }
1004194
public function clearCartItemsStockCache() {
    $items = $this->items();

    if (empty($items)) {
      return;
    }

    foreach ($items as $item) {
      $sku_entity = SKU::loadFromSku($item['sku']);
      $sku_entity->refreshStock();
    }
  }
509228
public function removeBundle($bundle)
    {
        $bundles = $this->getBundles();
        if (($key = array_search($this->getBundleString($bundle), $bundles)) !== false) {
            unset($bundles[$key]);
            $this->setBundles($bundles);
        }
    }
697665
def sku_delete(self, product_id, properties, session):
        ''''''
        request = TOPRequest('taobao.fenxiao.product.sku.delete')
        request['product_id'] = product_id
        request['properties'] = properties
        self.create(self.execute(request, session), fields=['result','created'], models={'created':TOPDate})
        return self
318472
public function getStock(string $sku) {
    $query = $this->connection->select('acm_sku_stock');
    $query->fields('acm_sku_stock');
    $query->condition('sku', $sku);
    $result = $query->execute()->fetchAll();

    // We may not have any entry.
    if (empty($result)) {
      return [];
    }

    // Log if more than one found.
    if (count($result) > 1) {
      $this->logger->error('Duplicate entries found for stock of sku @sku.', [
        '@sku' => $sku,
      ]);
    }

    // Get the first result.
    $data = reset($result);

    return (array) $data;
  }
903623
public function get($sku)
    {
        /** @var HandlerInterface $responseHandler */
        $responseHandler = $this->service()->get($this->baseUrlPath($sku));
        return $responseHandler;
    }
214824
public function delete()
	{
		parent::delete();

		$manager = \Aimeos\MShop::create( $this->getContext(), 'stock' );

		$code = $this->getView()->item->getCode();
		$search = $manager->createSearch();
		$search->setConditions( $search->compare( '==', 'stock.productcode', $code ) );

		$manager->deleteItems( array_keys( $manager->searchItems( $search ) ) );
	}
458959
public function pluginFromSku(SKU $sku) {
    if (empty($sku)) {
      return NULL;
    }

    $bundle = $sku->getType();

    if (empty($bundle)) {
      return NULL;
    }

    $plugin = NULL;

    try {
      $plugin = $this->getDefinition($bundle);
    }
    catch (PluginNotFoundException $exception) {
      \Drupal::logger('acm_sku')->notice(t("Bundle @bundle doesn't appear to
        have an implementation, please check the plugin id on your implementation
        of the SKU plugin", ['@bundle' => $bundle]));
    } finally {
      return $plugin;
    }
  }
401260
def reduce_stock(self, product_id, sku_info, quantity):
        
        return self._post(
            'merchant/stock/reduce',
            data={
                "product_id": product_id,
                "sku_info": sku_info,
                "quantity": quantity
            }
        )
931078
protected function updateCartQuantityCheckout($sku, array $item)
    {
        if (isset($this->data_cart['items'][$sku]['cart_id'])) {
            $cart_id = $this->data_cart['items'][$sku]['cart_id'];
            $this->cart->update($cart_id, array('quantity' => $item['quantity']));
        }
    }
309268
public function remove($key)
	{
		if(($item=parent::remove($key))!==null)
			$this->_form->removedElement($key,$item,$this->_forButtons);
	}
679677
public function removeItem(\Flowcode\ShopBundle\Entity\InventoryItem $item)
    {
        $this->items->removeElement($item);
        $item->setInventory(null);
    }