src/ShopProductExportBundle/objects/TPkgShopProductExportCSVEndPoint.class.php
protected function HandleArticle(&$oArticle, &$aFields)
    {
        /**
         * @var $logger LoggerInterface
         */
        $logger = ServiceLocator::get('logger');

        $iStart = microtime(true);
        static $iCount = 0;
        static $sMemUsageBeforeArticleProcessed = null;
        static $sMemUsageTmp = null;
        ++$iCount;
        if (null === $sMemUsageBeforeArticleProcessed) {
            $sMemUsageBeforeArticleProcessed = memory_get_usage();
            $sMemUsageTmp = $sMemUsageBeforeArticleProcessed;
        }

        $aFieldValues = array();
        reset($aFields);
        foreach ($aFields as $sFieldName) {
            $aFieldValues[] = $this->GetFieldValue($sFieldName, $oArticle);
        }
        $sLine = $this->getLine($aFieldValues);

        $this->Write($sLine.$this->lineBreak);

        $iLogCount = 1000;

        if (0 === $iCount % $iLogCount) {
            $sMemUsageAfterArticleProcessed = memory_get_usage();

            $sMemDifference = $sMemUsageAfterArticleProcessed - $sMemUsageBeforeArticleProcessed;
            $sMemDifference = $sMemDifference / 1024;
            $sMemDifference = $sMemDifference / 1024;

            $sMemDifferenceTmp = $sMemUsageAfterArticleProcessed - $sMemUsageTmp;
            $sMemDifferenceTmp = $sMemDifferenceTmp / 1024;
            $sMemDifferenceTmp = $sMemDifferenceTmp / 1024;

            if ($this->GetDebug()) {
                $logger->debug('memory difference after processing '.$iLogCount.' articles: '.$sMemDifference.'MB ('.$sMemDifferenceTmp.'MB for '.$iLogCount.' articles) - total article count: '.$iCount);
            }

            $sMemUsageTmp = $sMemUsageAfterArticleProcessed;
        }
        $iEnd = microtime(true);
        $iTime = $iEnd - $iStart;
        if ($this->GetDebug()) {
            $logger->debug("\n start ".$iStart."\n end ".$iEnd."\n time for one article: ".$iTime);
        }

        return $sLine;
    }
protected function HandleArticle(&$oArticle, &$aFields)
    {
        /**
         * @var $logger LoggerInterface
         */
        $logger = ServiceLocator::get('logger');

        $iStart = microtime(true);
        static $iCount = 0;
        static $sMemUsageBeforeArticleProcessed = null;
        static $sMemUsageTmp = null;
        ++$iCount;
        if (null === $sMemUsageBeforeArticleProcessed) {
            $sMemUsageBeforeArticleProcessed = memory_get_usage();
            $sMemUsageTmp = $sMemUsageBeforeArticleProcessed;
        }

        $aFieldValues = array();
        reset($aFields);
        foreach ($aFields as $sFieldName) {
            $aFieldValues[] = $this->GetFieldValue($sFieldName, $oArticle);
        }
        $sLine = $this->getLine($aFieldValues);

        $this->Write($sLine.$this->lineBreak);

        $iLogCount = 1000;

        if (0 === $iCount % $iLogCount) {
            $sMemUsageAfterArticleProcessed = memory_get_usage();

            $sMemDifference = $sMemUsageAfterArticleProcessed - $sMemUsageBeforeArticleProcessed;
            $sMemDifference = $sMemDifference / 1024;
            $sMemDifference = $sMemDifference / 1024;

            $sMemDifferenceTmp = $sMemUsageAfterArticleProcessed - $sMemUsageTmp;
            $sMemDifferenceTmp = $sMemDifferenceTmp / 1024;
            $sMemDifferenceTmp = $sMemDifferenceTmp / 1024;

            if ($this->GetDebug()) {
                $logger->debug('memory difference after processing '.$iLogCount.' articles: '.$sMemDifference.'MB ('.$sMemDifferenceTmp.'MB for '.$iLogCount.' articles) - total article count: '.$iCount);
            }

            $sMemUsageTmp = $sMemUsageAfterArticleProcessed;
        }
        $iEnd = microtime(true);
        $iTime = $iEnd - $iStart;
        if ($this->GetDebug()) {
            $logger->debug("\n start ".$iStart."\n end ".$iEnd."\n time for one article: ".$iTime);
        }

        return $sLine;
    }
protected function HandleArticle ( & $ oArticle , & $ aFields ) { /**
         * @var $logger LoggerInterface
         */ $ logger = ServiceLocator :: get ( 'logger' ) ; $ iStart = microtime ( true ) ; static $ iCount = 0 ; static $ sMemUsageBeforeArticleProcessed = null ; static $ sMemUsageTmp = null ; ++ $ iCount ; if ( null === $ sMemUsageBeforeArticleProcessed ) { $ sMemUsageBeforeArticleProcessed = memory_get_usage ( ) ; $ sMemUsageTmp = $ sMemUsageBeforeArticleProcessed ; } $ aFieldValues = array ( ) ; reset ( $ aFields ) ; foreach ( $ aFields as $ sFieldName ) { $ aFieldValues [ ] = $ this -> GetFieldValue ( $ sFieldName , $ oArticle ) ; } $ sLine = $ this -> getLine ( $ aFieldValues ) ; $ this -> Write ( $ sLine . $ this -> lineBreak ) ; $ iLogCount = 1000 ; if ( 0 === $ iCount % $ iLogCount ) { $ sMemUsageAfterArticleProcessed = memory_get_usage ( ) ; $ sMemDifference = $ sMemUsageAfterArticleProcessed - $ sMemUsageBeforeArticleProcessed ; $ sMemDifference = $ sMemDifference / 1024 ; $ sMemDifference = $ sMemDifference / 1024 ; $ sMemDifferenceTmp = $ sMemUsageAfterArticleProcessed - $ sMemUsageTmp ; $ sMemDifferenceTmp = $ sMemDifferenceTmp / 1024 ; $ sMemDifferenceTmp = $ sMemDifferenceTmp / 1024 ; if ( $ this -> GetDebug ( ) ) { $ logger -> debug ( 'memory difference after processing ' . $ iLogCount . ' articles: ' . $ sMemDifference . 'MB (' . $ sMemDifferenceTmp . 'MB for ' . $ iLogCount . ' articles) - total article count: ' . $ iCount ) ; } $ sMemUsageTmp = $ sMemUsageAfterArticleProcessed ; } $ iEnd = microtime ( true ) ; $ iTime = $ iEnd - $ iStart ; if ( $ this -> GetDebug ( ) ) { $ logger -> debug ( "\n start " . $ iStart . "\n end " . $ iEnd . "\n time for one article: " . $ iTime ) ; } return $ sLine ; }
do work for one article
loops through the available fields and calls GetFieldValue method for each field.

@param TdbShopArticle $oArticle
@param array          $aFields

@return string
do work for one article loops through the available fields and calls GetFieldValue method for each field .