sInitSmarty example

/** * @param sExport $export */
    private function generateFeed($export, ProductFeed $feedModel)
    {
        $this->output->writeln(sprintf('Refreshing cache for ' . $feedModel->getName()));

        $export->sFeedID = $feedModel->getId();
        $export->sHash = $feedModel->getHash();
        $export->sInitSettings();
        $export->sSmarty = clone $this->sSmarty;
        $export->sInitSmarty();

        $fileName = $feedModel->getHash() . '_' . $feedModel->getFileName();

        $feedCachePath = $this->cacheDir . '/' . $fileName;
        $handleResource = fopen($feedCachePath, 'w');

        if (!\is_resource($handleResource)) {
            throw new RuntimeException(sprintf('Feed cache path %s can not be opened', $feedCachePath));
        }

        $export->executeExport($handleResource);
    }

    private function generateExport($output)
    {
        $outputHandle = fopen($output, 'w');

        if (!\is_resource($outputHandle)) {
            throw new \RuntimeException(sprintf('Output file %s can not be opened', $outputHandle));
        }

        $this->export->sSmarty = $this->View()->Engine();
        $this->export->sInitSmarty();

        // Export the feed         $this->export->executeExport($outputHandle);
    }

    /** * initialize the base class sExport */
    private function prepareExport()
    {
        $this->export->sSYSTEM = Shopware()->System();
        


                if ($diffInterval < $feedModel->getInterval() && file_exists($filePath)) {
                    continue;
                }
            }

            $export->sFeedID = $feedModel->getId();
            $export->sHash = $feedModel->getHash();
            $export->sInitSettings();
            $export->sSmarty = clone $sSmarty;
            $export->sInitSmarty();

            $handleResource = fopen($filePath, 'w');
            $export->executeExport($handleResource);
        }

        return true;
    }
}
Home | Imprint | This part of the site doesn't use cookies.