Is called when new basket item is successfully added.

@param bool $blOverride marker to accumulate passed amount or renew (default false).
327777
protected function addedNewItem($blOverride)
    {
        if (!$blOverride) {
            $this->_blNewITemAdded = null;
            \OxidEsales\Eshop\Core\Registry::getSession()->setVariable("blAddedNewItem", true);
        }
    }
773741
protected function _onChangeResetCounts($sOxid, $sVendorId = null, $sManufacturerId = null)
    {
        $myUtilsCount = \OxidEsales\Eshop\Core\Registry::getUtilsCount();

        if ($sVendorId) {
            $myUtilsCount->resetVendorArticleCount($sVendorId);
        }

        if ($sManufacturerId) {
            $myUtilsCount->resetManufacturerArticleCount($sManufacturerId);
        }

        $aCategoryIds = $this->getCategoryIds();
        //also reseting category counts
        foreach ($aCategoryIds as $sCatId) {
            $myUtilsCount->resetCatArticleCount($sCatId);
        }
    }
412985
public function setIsNewBasket()
    {
        $this->_blNewBasket = true;
        $iTime = \OxidEsales\Eshop\Core\Registry::getUtilsDate()->getTime();
        $this->oxuserbaskets__oxupdate = new \OxidEsales\Eshop\Core\Field($iTime);
    }
862320
public function addToCart(
        $contentIds = [],
        $contentName = null,
        $contentCategory = null,
        $value = null,
        $currency = null
    )
    {
        $this->sendEventToOutput(
            self::EVENT_ADD_TO_CART,
            $this->prepareProductsToParameters($contentIds, $contentName, $contentCategory, $value, $currency)
        );
    }
371080
protected void putBoolean(boolean data)
    {
        if (tc.isEntryEnabled()) Tr.entry(tc, "putBoolean", new Object[] { this, new Boolean(data)});

        if (tc.isDebugEnabled()) Tr.debug(tc, "Writing at position " + _buffer.position());
        _buffer.put(data ? TRUE : FALSE);

        if (tc.isEntryEnabled()) Tr.exit(tc, "putBoolean");
    }
164073
public function markApproved()
    {
        $this->IsSpam = false;
        $this->Moderated = true;
        $this->write();
        $this->extend('afterMarkApproved');
    }
369424
public function updateAppServerInformation($adminMode)
    {
        $this->appServerDao->startTransaction();
        try {
            /** @var \OxidEsales\Eshop\Core\DataObject\ApplicationServer $appServer */
            $appServer = $this->appServerDao->findAppServer($this->utilsServer->getServerNodeId());
            if ($appServer === null) {
                $this->addNewAppServerData($adminMode);
            } elseif ($appServer->needToUpdate($this->currentTime)) {
                $this->updateAppServerData($appServer, $adminMode);
            }
        } catch (\Exception $exception) {
            $this->appServerDao->rollbackTransaction();
            throw $exception;
        }
        $this->appServerDao->commitTransaction();
    }
1351038
protected function onBeforeWrite() {
        parent::onBeforeWrite();
        
        if($this->ID==0) {
            $this->CreatorID=Member::currentUserID();
        }else {
            $this->LastEditorID=Member::currentUserID();
            
            //If the language is changing reset the folder id
            if($this->isChanged('LanguageID')) {
                $this->FolderID=0;
            }
        }
    }
541449
@Override
    public synchronized void setBifurcatedConsumerCloseRedeliveryMode(boolean bumpRedeliveryOnClose)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        {
            SibTr.entry(tc, "setBifurcatedConsumerCloseRedeliveryMode", Boolean.valueOf(bumpRedeliveryOnClose));
            SibTr.exit(tc, "setBifurcatedConsumerCloseRedeliveryMode");
        }
        bumpRedeliveryOnBifurcatedClose = bumpRedeliveryOnClose;
    }
1315126
public function onBeforeWrite()
    {
        $owner = $this->owner;
        if(!$owner->ID && !$owner->SubsiteID){
            $owner->SubsiteID = Subsite::currentSubsiteID();
        }
        parent::onBeforeWrite();
    }
998824
public function onBeforeWrite()
    {
        parent::onBeforeWrite();

        // Generate a unique item key based on the current ID and customisations
        $key = base64_encode(json_encode($this->Customisations()->map("Title", "Value")->toArray()));
        $this->Key = $this->StockID . ':' . $key;
    }
1091473
private function afterTransactionRolledBack()
    {
        if ( ! $this->hasCache) {
            return;
        }

        foreach ($this->persisters as $persister) {
            if ($persister instanceof CachedPersister) {
                $persister->afterTransactionRolledBack();
            }
        }

        foreach ($this->collectionPersisters as $persister) {
            if ($persister instanceof CachedPersister) {
                $persister->afterTransactionRolledBack();
            }
        }
    }
513198
public function toCompareList(
        $sProductId = null,
        $dAmount = null,
        $aSel = null,
        $blOverride = false,
        $blBundle = false
    ) {
        // only if enabled and not search engine..
        if ($this->getViewConfig()->getShowCompareList() && !\OxidEsales\Eshop\Core\Registry::getUtils()->isSearchEngine()) {
            // #657 special treatment if we want to put on comparelist
            $blAddCompare = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('addcompare');
            $blRemoveCompare = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('removecompare');
            $sProductId = $sProductId ? $sProductId : \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('aid');
            if (($blAddCompare || $blRemoveCompare) && $sProductId) {
                // toggle state in session array
                $aItems = \OxidEsales\Eshop\Core\Registry::getSession()->getVariable('aFiltcompproducts');
                if ($blAddCompare && !isset($aItems[$sProductId])) {
                    $aItems[$sProductId] = true;
                }

                if ($blRemoveCompare) {
                    unset($aItems[$sProductId]);
                }

                \OxidEsales\Eshop\Core\Registry::getSession()->setVariable('aFiltcompproducts', $aItems);
                $oParentView = $this->getParent();

                // #843C there was problem then field "blIsOnComparisonList" was not set to article object
                if (($oProduct = $oParentView->getViewProduct())) {
                    if (isset($aItems[$oProduct->getId()])) {
                        $oProduct->setOnComparisonList(true);
                    } else {
                        $oProduct->setOnComparisonList(false);
                    }
                }

                $aViewProds = $oParentView->getViewProductList();
                if (is_array($aViewProds) && count($aViewProds)) {
                    foreach ($aViewProds as $oProduct) {
                        if (isset($aItems[$oProduct->getId()])) {
                            $oProduct->setOnComparisonList(true);
                        } else {
                            $oProduct->setOnComparisonList(false);
                        }
                    }
                }
            }
        }
    }
820268
public function processSpringbotAbandonedCart($from, $data)
		{
			$form_data = array(
				'from' => $from,
				'data' => $data
			);
			$this->call('springbot_process_abandoned_cart', $form_data);

			return TRUE;
		}
325371
public function place($subscribe = false)
    {
        if (self::STATUS_CART != $this->getStatusCode())
        {
            throw new \Exception('Only orders of type cart may be placed');
        }

        $this->setStatusCode(self::STATUS_NEW);

        foreach ($this->getLineItems() as $lineItem)
        {
            $quantity = $lineItem->getQuantity();

            // Decrement stock from Product
            $product = $lineItem->getProduct();
            $product->setQuantityOnHold($product->getQuantityOnHold()+$quantity);
            $product->setQuantityAvailable($product->getQuantityAvailable()-$quantity);

            // Create stock transaction for each line item
            $stockTransaction = new OrderStockTransaction();
            $stockTransaction->setQuantity(-1*$quantity);
            $stockTransaction->setProduct($product);
            $stockTransaction->setStatusCode(OrderStockTransaction::STATUS_PENDING);

            $lineItem->setStockTransaction($stockTransaction);

            // Subscribe, if necessary
            if ($subscribe)
            {
                $lineItem->subscribe();
            }
        }
    }
502032
public function addValue($key, $value, $overwrite = false)
    {
        if (!isset($this->data[$key]) || $overwrite) {
            $this->data[$key] = (string) $value;
        }
    }
1174745
public function onBeforeWrite()
    {
        if (!$this->isInDB()) {
            $this->CreatorID = Member::currentUserID();
        }

        if (!$this->VersionNumber) {
            $versions = DataObject::get(
                'FileVersion', sprintf('"FileID" = %d', $this->FileID)
            );

            if ($versions) {
                $this->VersionNumber = $versions->Count() + 1;
            } else {
                $this->VersionNumber = 1;
            }
        }

        if (!$this->Filename) {
            $this->Filename = $this->saveCurrentVersion();
        }

        parent::onBeforeWrite();
    }