/** * Download package * * @return boolean */ public function download() { $result = false; $licenseKey = $this->getModuleForUpgrade()->getLicenseKey(); $path = \XLite\Core\Marketplace::getInstance()->getAddonPack($this->getMarketplaceID(), $licenseKey ? $licenseKey->getKeyValue() : null); $params = array('name' => $this->getActualName()); if (isset($path)) { $this->addFileInfoMessage('Module pack ("{{name}}") is received', $path, true, $params); $this->setRepositoryPath($path); $this->saveHashesForInstalledFiles(); $result = parent::download(); } else { $error = \XLite\Core\Marketplace::getInstance()->getError(); if (static::LICENSE_ERROR === $error) { $this->addToPremiumLicenseModules(); } else { $this->addFileErrorMessage('Module pack ("{{name}}") is not received', $error, true, $params); } } return $result; }
/** * Names of variables to serialize * * @return array */ public function __sleep() { $list = parent::__sleep(); $list[] = 'metadata'; return $list; }