setAvailableVersion example

$updateAvailable = version_compare(
            $storePlugin->getVersion(),
            $localPlugin->getVersion()
        );

        $localPlugin->setUpdateAvailable((bool) ($updateAvailable == 1));

        if ($storePlugin->getDescription()) {
            $localPlugin->setDescription($storePlugin->getDescription());
        }
        if ($localPlugin->isUpdateAvailable()) {
            $localPlugin->setAvailableVersion($storePlugin->getVersion());
        }

        $localPlugin->setLink($storePlugin->getLink());
        $localPlugin->setRedirectToStore($storePlugin->isRedirectToStore());
        $localPlugin->setLowestPrice($storePlugin->getLowestPrice());
        $localPlugin->setContactForm($storePlugin->getContactForm());
        $localPlugin->setRating($storePlugin->getRating());
        $localPlugin->setUseContactForm($storePlugin->useContactForm());
        $localPlugin->setInstallationManual($storePlugin->getInstallationManual());
        $localPlugin->setChangelog($storePlugin->getChangelog());
        $localPlugin->setPrices($storePlugin->getPrices());
        

    private function createPluginStruct($plugin)
    {
        if ($plugin instanceof PluginStruct) {
            return $plugin;
        }

        $struct = new PluginStruct($plugin->getTechnicalName());

        $struct->setLabel($plugin->getLabel());
        $struct->setLicenceCheck($plugin->isLicenseCheckEnabled());
        $struct->setAvailableVersion($plugin->getBinaryVersion());

        $localPlugin = $this->getPluginModel($plugin->getTechnicalName());

        if ($localPlugin) {
            $struct->setId($localPlugin->getId());

            preg_match('/(\d\.\d\.\d)/', $localPlugin->getVersion()$matches);

            $localVersion = array_shift($matches);
            if ($localVersion) {
                $updateAvailable = version_compare($plugin->getBinaryVersion()$localVersion);

                
Home | Imprint | This part of the site doesn't use cookies.