return true if this is a download product.

@return bool
518151
public function isDownload()
    {
        $db = \ChameleonSystem\CoreBundle\ServiceLocator::get('database_connection');
        $query = 'select COUNT(*) AS matches FROM `shop_order_item_download_cms_document_mlt`
                   WHERE `source_id` = :shopOrderItemId';
        $result = $db->fetchAssoc($query, array('shopOrderItemId' => $this->id));

        return intval($result['matches']) > 0;
    }
1187324
public function isAvailable(): bool
    {
        if (!file_exists("{$this->projectRootDir}/config/bundles.php")) {
            return false;
        }
        $sourcePath = "{$this->packageInstallDir}/.installer/%s/bundles.php";
        foreach ($this->projectType->getProjectDirs() as $projectDir) {
            $bundleFile = sprintf($sourcePath, $projectDir);
            if (is_file($bundleFile)) {
                return true;
            }
        }

        return false;
    }
458122
function has_any_active_valid_license() {
            if ( ! fs_is_network_admin() ) {
                return $this->has_active_valid_license();
            }

            $installs            = $this->get_blog_install_map();
            $all_plugin_licenses = self::get_all_licenses( $this->_module_id );

            foreach ( $installs as $blog_id => $install ) {
                if ( ! FS_Plugin_License::is_valid_id( $install->license_id ) ) {
                    continue;
                }

                foreach ( $all_plugin_licenses as $license ) {
                    if ( $license->id == $install->license_id ) {
                        if ( self::is_active_valid_license( $license ) ) {
                            return true;
                        }
                    }
                }
            }

            return false;
        }
789045
public function isCoursera() {
        $product = $this->ltiRawParameter('tool_consumer_info_product_family_code', false);
        $tci_description = $this->ltiRawParameter('tool_consumer_instance_description', false);
        return ( $product == 'ims' && $tci_description == 'Coursera');
    }
434466
public function check(): bool
    {
        return $this->installable = $this->items->filter(function ($specification) {
            return $specification->check() === false && $specification->optional() === false;
        })->isEmpty();
    }
862374
public function download()
    {
        $oUtils = \OxidEsales\Eshop\Core\Registry::getUtils();
        $sFileName = $this->_getFilenameForUrl();
        $sFileLocations = $this->getStoreLocation();

        if (!$this->exist() || !$this->isUnderDownloadFolder()) {
            throw new \OxidEsales\Eshop\Core\Exception\StandardException('EXCEPTION_NOFILE');
        }

        $oUtils->setHeader("Pragma: public");
        $oUtils->setHeader("Expires: 0");
        $oUtils->setHeader("Cache-Control: must-revalidate, post-check=0, pre-check=0, private");
        $oUtils->setHeader('Content-Disposition: attachment;filename=' . $sFileName);
        $oUtils->setHeader("Content-Type: application/octet-stream");
        if ($iFileSize = $this->getSize()) {
            $oUtils->setHeader("Content-Length: " . $iFileSize);
        }
        readfile($sFileLocations);
        $oUtils->showMessageAndExit(null);
    }
809494
public static function isEnabled()
    {
        $app = Facade::getFacadeApplication();
        $cache = $app->make('cache/request');
        $item = $cache->getItem('multilingual/enabled');
        if (!$item->isMiss()) {
            return $item->get();
        }

        $item->lock();
        $result = false;
        if ($app->isInstalled()) {
            $site = $app->make('site')->getSite();
            if (count($site->getLocales()) > 1) {
                $result = true;
            }
        }

        $cache->save($item->set($result));

        return $result;
    }
846843
public function check_activation() {
		$license_data = get_option( $this->product->get_key() . '_license_data', '' );
		if ( '' === $license_data ) {
			return false;
		}

		return isset( $license_data->error ) ? ( 'no_activations_left' == $license_data->error ) : false;

	}
163206
public function isProd(): bool
    {
        $nodeType = $this->isEmulated()
            ? $this->emulatedNodeType
            : $this->nodeType;

        return ($nodeType === self::PROD || $nodeType === self::STAGE);
    }
1233949
public function hasArticlesWithDownloadableAgreement()
    {
        $blHasArticlesWithIntangibleAgreement = false;

        /** @var \OxidEsales\Eshop\Application\Model\BasketItem $oBasketItem */
        foreach ($this->_aBasketContents as $oBasketItem) {
            if ($oBasketItem->getArticle(false) && $oBasketItem->getArticle(false)->hasDownloadableAgreement()) {
                $blHasArticlesWithIntangibleAgreement = true;
                break;
            }
        }

        return $blHasArticlesWithIntangibleAgreement;
    }
596782
public function hasValidDownloads()
    {
        if ($this->_blHasValidDownloads == null) {
            $this->_blHasValidDownloads = false;
            $sNow = date('Y-m-d H:i:s', \OxidEsales\Eshop\Core\Registry::getUtilsDate()->getTime());
            $sFileId = $this->getId();

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

            $sSql = "SELECT
                        `oxorderfiles`.`oxid`
                     FROM `oxorderfiles`
                        LEFT JOIN `oxorderarticles` ON `oxorderarticles`.`oxid` = `oxorderfiles`.`oxorderarticleid`
                        LEFT JOIN `oxorder` ON `oxorder`.`oxid` = `oxorderfiles`.`oxorderid`
                     WHERE `oxorderfiles`.`oxfileid` = " . $oDb->quote($sFileId) . "
                        AND ( ! `oxorderfiles`.`oxmaxdownloadcount` OR `oxorderfiles`.`oxmaxdownloadcount` > `oxorderfiles`.`oxdownloadcount`)
                        AND ( `oxorderfiles`.`oxvaliduntil` = '0000-00-00 00:00:00' OR `oxorderfiles`.`oxvaliduntil` > '{$sNow}' )
                        AND `oxorder`.`oxstorno` = 0
                        AND `oxorderarticles`.`oxstorno` = 0";

            if ($oDb->getOne($sSql)) {
                $this->_blHasValidDownloads = true;
            }
        }

        return $this->_blHasValidDownloads;
    }
758358
public function export()
    {
        $products = $this->repository->all();
        $fileName = strtolower(str_random()) . '.csv';
        $dirPath = storage_path('app/public/catalog');
        $this->directory($dirPath);
       
        $file = fopen($dirPath . '/' . $fileName, 'w');
        foreach ($products as $product) {
            fputcsv($file, $product->toArray());
        }
        fclose($file);
        
        return response()->download($dirPath . '/' . $fileName);
    }
149963
public function result()
    {
        if ($this->_res === false) {
            return false;
        }

        $rows = [];

        $rows[] = array(
            'type' => 'header',
            'columns' => array(
                'Torrent',
                array(1, 'Done', '10%'),
                'State',
                'Have',
                'Uploaded',
                'Time Left',
                'Ratio',
                'Up',
                'Down',
            ),
        );

        if (count($this->_torrents) == 0) {
            $rows[] = array(
                'type' => 'none',
                'columns' => array(
                    array(9, 'None found'),
                ),
            );
        } else {

            $status_tally = [];

            $status_tally['Downloaded'] = 0;
            $status_tally['Uploaded'] = 0;

            foreach ($this->_torrents as $torrent) {

                $status_tally[$torrent['state']] = !array_key_exists($torrent['state'], $status_tally) ? 1 : $status_tally[$torrent['state']] + 1;
                $have_bytes = $torrent['have'];
                $uploaded_bytes = $torrent['uploaded'];

                if (is_numeric($have_bytes) && $have_bytes > 0 && is_numeric($uploaded_bytes) && $uploaded_bytes > 0) {
                    $status_tally['Downloaded'] += $have_bytes;
                    $status_tally['Uploaded'] += $uploaded_bytes;
                }

                $rows[] = array(
                    'type' => 'values',
                    'columns' => array(
                        wordwrap(htmlspecialchars($torrent['torrent']), 50, ' ', true),

                        '<div class="bar_chart">
                          <div class="bar_inner" style="width: '.(int) $torrent['done'].'%;">
                            <div class="bar_text">
                              '.($torrent['done'] ? $torrent['done'].'%' : '0%').'
                            </div>
                          </div>
                        </div>',

                        $torrent['state'],
                        $have_bytes !== false ? Common::byteConvert($have_bytes) : $torrent['have'],
                        $uploaded_bytes !== false ? Common::byteConvert($uploaded_bytes) : 'None',
                        $torrent['eta'] == -1 ? 'N/A' : Common::secondsConvert($torrent['eta']),
                        max(0, $torrent['ratio']),
                        Common::byteConvert($torrent['up']).'/s',
                        Common::byteConvert($torrent['down']).'/s',
                    ),
                );
            }

            $status_tally['Ratio'] = $status_tally['Downloaded'] > 0 && $status_tally['Uploaded'] > 0 ? round($status_tally['Uploaded'] / $status_tally['Downloaded'], 2) : 'N/A';
            $status_tally['Downloaded'] = $status_tally['Downloaded'] > 0 ? Common::byteConvert($status_tally['Downloaded']) : 'None';
            $status_tally['Uploaded'] = $status_tally['Uploaded'] > 0 ? Common::byteConvert($status_tally['Uploaded']) : 'None';

            if (count($status_tally) > 0) {

                $tally_contents = [];

                foreach ($status_tally as $state => $tally) {
                    $tally_contents[] = $state.': '.$tally;
                }

                $rows[] = array(
                    'type' => 'values',
                    'columns' => array(
                        array(9, implode(', ', $tally_contents)),
                    ),
                );
            }
        }

        if (
            is_array($this->_stats) &&
            array_key_exists('downloaded-bytes', $this->_stats) &&
            array_key_exists('uploaded-bytes', $this->_stats) &&
            array_key_exists('seconds-active', $this->_stats
        )) {
            $extra_vals = array(
                'title' => 'Transmission Stats',
                'values' => array(
                    array('Total Downloaded', Common::byteConvert($this->_stats['downloaded-bytes'])),
                    array('Total Uploaded', Common::byteConvert($this->_stats['uploaded-bytes'])),
                    $this->_stats['uploaded-bytes'] > 0 && $this->_stats['downloaded-bytes'] > 0 ? array('Total Ratio', round($this->_stats['uploaded-bytes'] / $this->_stats['downloaded-bytes'], 3)) : false,
                    array('Duration', Common::secondsConvert($this->_stats['seconds-active'])),
                ),
            );
        } else {
            $extra_vals = false;
        }

        return array(
            'root_title' => 'Transmission Torrents',
            'rows' => $rows,
            'extra_type' => 'k->v',
            'extra_vals' => $extra_vals,
        );
    }
675027
public function hasDownloadableProducts()
    {
        $this->_blDownloadableProducts = false;
        /** @var \OxidEsales\Eshop\Application\Model\BasketItem $oBasketItem */
        foreach ($this->_aBasketContents as $oBasketItem) {
            if ($oBasketItem->getArticle(false) && $oBasketItem->getArticle(false)->isDownloadable()) {
                $this->_blDownloadableProducts = true;
                break;
            }
        }

        return $this->_blDownloadableProducts;
    }
1337037
protected function install()
    {
        $file = $this->download();

        if (empty($file)) {
            return false;
        }

        $result = $this->install->fromZip($file);

        if ($result !== true) {
            $this->setError($result);
            return false;
        }

        if ($this->install->isUpdate()) {
            $this->job['updated']++;
        } else {
            $this->job['inserted']++;
        }

        return true;
    }
163267
protected function downloadFile() {
        // if the file exists already, return out, file already was downloaded
        if (file_exists($this->downloadFilePath())) {
            return;
        }
        
        // download the file
        $file = file_get_contents($this->url());

        // if it was not possible to get the file content, throw a new error
        if ($file === false) {
            throw new \Th\FileDownloader\Exceptions\DownloadException(99);
        }

        // try writing the file to disk
        $downloadResult = file_put_contents($this->downloadFilePath(), $file);

        // if it is not possible to download the file, return
        if ($downloadResult === false) {
            throw new \Th\FileDownloader\Exceptions\DownloadException(99);
        }
    }
826659
public function isUnderDownloadFolder()
    {
        $storageLocation = realpath($this->getStoreLocation());

        if ($storageLocation === false) {
            return false;
        }

        $downloadFolder = realpath($this->_getBaseDownloadDirPath());

        return strpos($storageLocation, $downloadFolder) !== false;
    }