Copies passed to method product into $this.

@param string $sOxId object id

@return null
351112
public function loadOrderArticlesForUser($sOxId)
    {
        if (!$sOxId) {
            $this->clear();

            return;
        }

        $sSelect = "SELECT oxorderarticles.* FROM oxorder ";
        $sSelect .= "left join oxorderarticles on oxorderarticles.oxorderid = oxorder.oxid ";
        $sSelect .= "left join oxarticles on oxorderarticles.oxartid = oxarticles.oxid ";
        $sSelect .= "WHERE oxorder.oxuserid = " . \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quote($sOxId);

        $this->selectString($sSelect);
    }
752249
public function withMethod(string $method): self {
        if ($this->method === $method) {
            return $this;
        }

        $clone = clone $this;
        $clone->method = $method;

        return $clone;
    }
344595
protected function _deleteVariantRecords($sOXID)
    {
        if ($sOXID) {
            $database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
            //collect variants to remove recursively
            $query= 'select oxid from ' . $this->getViewName() . ' where oxparentid = ?';
            $rs = $database->select($query, [$sOXID]);
            $oArticle = oxNew(\OxidEsales\Eshop\Application\Model\Article::class);
            if ($rs != false && $rs->count() > 0) {
                while (!$rs->EOF) {
                    $oArticle->setId($rs->fields[0]);
                    $oArticle->delete();
                    $rs->fetchRow();
                }
            }
        }
    }
654790
protected function _getLanguageInfo($sOxId)
    {
        $sDefaultLang = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('sDefaultLang');

        $aLangData = $this->_aLangData['params'][$sOxId];
        $aLangData['abbr'] = $sOxId;
        $aLangData['desc'] = $this->_aLangData['lang'][$sOxId];
        $aLangData['baseurl'] = $this->_aLangData['urls'][$aLangData['baseId']];
        $aLangData['basesslurl'] = $this->_aLangData['sslUrls'][$aLangData['baseId']];
        $aLangData['default'] = ($this->_aLangData['params'][$sOxId]["baseId"] == $sDefaultLang) ? true : false;

        return $aLangData;
    }
43121
public function delete($sOxId = null)
    {
        if (!$sOxId) {
            $sOxId = $this->getId();
        }
        if (!$sOxId) {
            return false;
        }

        $blDeleted = parent::delete($sOxId);

        if ($blDeleted) {
            $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
            $sDelete = "delete from oxobject2group where oxobject2group.oxshopid = '" . $this->getShopId() . "' and oxobject2group.oxobjectid = " . $oDb->quote($sOxId);
            $oDb->execute($sDelete);
        }

        return $blDeleted;
    }
649674
public function copyThis($oProduct)
    {
        $aObjectVars = get_object_vars($oProduct);

        foreach ($aObjectVars as $sName => $sValue) {
            if (isset($oProduct->$sName->value)) {
                $sFieldName = preg_replace('/oxarticles__/', 'oxorderarticles__', $sName);
                if ($sFieldName != "oxorderarticles__oxtimestamp") {
                    $this->$sFieldName = $oProduct->$sName;
                }
                // formatting view
                if (!\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blSkipFormatConversion')) {
                    if ($sFieldName == "oxorderarticles__oxinsert") {
                        \OxidEsales\Eshop\Core\Registry::getUtilsDate()->convertDBDate($this->$sFieldName, true);
                    }
                }
            }
        }
    }
1057117
private function getStat($stat, $soxi_arg, $cast)
    {
        if (!isset($this->$stat)) {
            $this->$stat = isset($this->stats) ?
                    (float)$this->stats->$stat :
                    (float)$this->soxi($soxi_arg);
        
            settype($this->$stat, $cast);
        }
        
        return $this->$stat;
    }
966757
public function void($transactionId)
    {
        $xml = new DOMDocument();
        $transaction = $xml->createElement('hps:Transaction');
        $void = $xml->createElement('hps:AltPaymentVoid');

        $void->appendChild($xml->createElement('hps:TransactionType', $this->_transactionType));
        $void->appendChild($xml->createElement('hps:GatewayTxnId', $transactionId));

        $transaction->appendChild($void);
        return $this->_submitTransaction($transaction, 'AltPaymentVoid');
    }
580331
public function clone($modelitemId)
    {
        event(new BeforeClone($this));

        $this->beforeClone();

        $this->doClone();

        $this->afterClone();

        event(new AfterClone($this));
    }
586568
public function delete($sOxId = null)
    {
        if (!$sOxId) {
            $sOxId = $this->getId();
        }
        if (!$sOxId) {
            return false;
        }

        $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();

        $sOxIdQuoted = $oDb->quote($sOxId);
        $oDb->execute('delete from oxobject2payment where oxobjectid = ' . $sOxIdQuoted);
        $oDb->execute('delete from oxobject2delivery where oxdeliveryid = ' . $sOxIdQuoted);
        $oDb->execute('delete from oxdel2delset where oxdelsetid = ' . $sOxIdQuoted);

        return parent::delete($sOxId);
    }
1100165
public function clonePSE(ProductCloneEvent $event)
    {
        $clonedProduct = $event->getClonedProduct();

        // Get original product's PSEs
        $originalProductPSEs = ProductSaleElementsQuery::create()
            ->orderByIsDefault(Criteria::DESC)
            ->findByProductId($event->getOriginalProduct()->getId());

        /**
         * Handle PSEs
         *
         * @var int  $key
         * @var ProductSaleElements $originalProductPSE
         */
        foreach ($originalProductPSEs as $key => $originalProductPSE) {
            $currencyId = ProductPriceQuery::create()
                ->filterByProductSaleElementsId($originalProductPSE->getId())
                ->select('CURRENCY_ID')
                ->findOne();

            // The default PSE, created at the same time as the clone product, is overwritten
            $clonedProductPSEId = $this->createClonePSE($event, $originalProductPSE, $currencyId);

            $this->updateClonePSE($event, $clonedProductPSEId, $originalProductPSE, $key);

            // PSE associated images
            $originalProductPSEImages = ProductSaleElementsProductImageQuery::create()
                ->findByProductSaleElementsId($originalProductPSE->getId());

            if (null !== $originalProductPSEImages) {
                $this->clonePSEAssociatedFiles($clonedProduct->getId(), $clonedProductPSEId, $originalProductPSEImages, $type = 'image');
            }

            // PSE associated documents
            $originalProductPSEDocuments = ProductSaleElementsProductDocumentQuery::create()
                ->findByProductSaleElementsId($originalProductPSE->getId());

            if (null !== $originalProductPSEDocuments) {
                $this->clonePSEAssociatedFiles($clonedProduct->getId(), $clonedProductPSEId, $originalProductPSEDocuments, $type = 'document');
            }
        }
    }
1265945
public function exists($sOXID = null)
    {
        if (!$sOXID) {
            $sOXID = $this->getId();
        }
        //#5901 if physical record exists return true unconditionally
        if (parent::exists($sOXID)) {
            $this->setId($sOXID);
            return true;
        }

        //additional username check
        //This part is used by not yet saved user object, to detect the case when such username exists in db.
        //Basically it is called when anonymous visitor enters existing username for newsletter subscription
        //see Newsletter::send()
        //TODO: transfer this validation to newsletter part
        $sShopSelect = '';
        if (!$this->_blMallUsers && $this->oxuser__oxrights->value != 'malladmin') {
            $sShopSelect = ' AND oxshopid = "' . \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId() . '" ';
        }

        // We force reading from master to prevent issues with slow replications or open transactions (see ESDEV-3804).
        $masterDb = \OxidEsales\Eshop\Core\DatabaseProvider::getMaster();
        $sSelect = 'SELECT oxid FROM ' . $this->getViewName() . '
                    WHERE ( oxusername = ' . $masterDb->quote($this->oxuser__oxusername->value) . ' ) ';
        $sSelect .= $sShopSelect;

        if (($sOxid = $masterDb->getOne($sSelect))) {
            // update - set oxid
            $this->setId($sOxid);

            return true;
        }

        return false;
    }
546332
function copy() {
    $serialized_contents = serialize($this);
    $copy = unserialize($serialized_contents);
    unset( $copy->propix );
    return $copy;
 }
170253
public function copyFrom( MShop_Product_Item_Interface $product )
	{
		$this->setName( $product->getName() );
		$this->setType( $product->getType() );
		$this->setSupplierCode( $product->getSupplierCode() );
		$this->setProductCode( $product->getCode() );
		$this->setProductId( $product->getId() );

		$items = $product->getRefItems( 'media', 'default', 'default' );
		if( ( $item = reset( $items ) ) !== false ) {
			$this->setMediaUrl( $item->getUrl() );
		}

		$this->setModified();
	}
299390
public function sox()
    {
        $args = func_get_args();
        array_unshift($args, $this->filename);
        
        return self::exec('sox', $args);
    }
935033
public function copy($name = null, $tsgid = 0, $type = TeamSpeak3::GROUP_DBTYPE_REGULAR)
  {
    return $this->getParent()->serverGroupCopy($this->getId(), $name, $tsgid, $type);
  }
58361
public function copy(string $customerId, array $data, array $headers = [])
    {
        $url = $this->url('customers/%s/copy_card', $customerId);

        return $this->post($url, $data, $headers);
    }