Piwik\Plugins\Marketplace\Consumer::clearCache PHP Method

clearCache() public method

public clearCache ( )
    public function clearCache()
    {
        $this->consumer = false;
        $this->isValid = null;
    }

Usage Example

Ejemplo n.º 1
0
 public function subscriptionOverview()
 {
     Piwik::checkUserHasSuperUserAccess();
     // we want to make sure to fetch the latest results, eg in case user has purchased a subscription meanwhile
     // this is also like a self-repair to clear the caches :)
     $this->marketplaceApi->clearAllCacheEntries();
     $this->consumer->clearCache();
     $hasLicenseKey = $this->licenseKey->has();
     $consumer = $this->consumer->getConsumer();
     $subscriptions = array();
     $loginUrl = '';
     if (!empty($consumer['loginUrl'])) {
         $loginUrl = $consumer['loginUrl'];
     }
     if (!empty($consumer['licenses'])) {
         foreach ($consumer['licenses'] as $subscription) {
             $subscription['start'] = $this->getPrettyLongDate($subscription['startDate']);
             $subscription['end'] = $this->getPrettyLongDate($subscription['endDate']);
             $subscription['nextPayment'] = $this->getPrettyLongDate($subscription['nextPaymentDate']);
             $subscriptions[] = $subscription;
         }
     }
     return $this->renderTemplate('@Marketplace/subscription-overview', array('hasLicenseKey' => $hasLicenseKey, 'subscriptions' => $subscriptions, 'loginUrl' => $loginUrl, 'numUsers' => $this->environment->getNumUsers()));
 }