We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
/** * Calculates the bitmask of the boolean features selected * by the merchant and returns the corresponding value in binary format. * * @return int */ protected function calculatePlanId(PremiumStoreEmbeddable $features, array $options) { // No feature is selected $booleanBitmask = 0; $amount = 0; if ($features->hasAds()) { $amount += $this->plans['boolean']['ads']['price'][$options['currency']][$options['interval']]; $booleanBitmask += PremiumStoreEmbeddable::ADS; } if ($features->hasSeo()) { $amount += $this->plans['boolean']['seo']['price'][$options['currency']][$options['interval']]; $booleanBitmask += PremiumStoreEmbeddable::SEO; } if ($features->hasSocial()) { $amount += $this->plans['boolean']['social']['price'][$options['currency']][$options['interval']]; $booleanBitmask += PremiumStoreEmbeddable::SOCIAL; } $booleanBitmask = decbin($booleanBitmask); return $booleanBitmask . '_' . $options['interval'] . '_' . $options['trial_period_days'] . '_' . $options['currency'] . '_' . $amount; } /** * Sets the general configurations (as prices, for examples) in the FeatureInterface objects loaded from a * SubscriptionInterface object. */ private function configurePricesInSubscriptionFeatures(SubscriptionInterface $subscription) { /** @var FeatureInterface $feature * foreach ($subscription->getFeatures() as $feature) { $prices = $this->getConfiguredFeatures()->get($feature->getName())->getPrices(); $feature->setPrices($prices); } }
This code once was in SerendipityHQ\Bundle\FeaturesBundle\Service\FeaturesManager. Removed because it causes troubles when applying Rector and PHP CS Fixer.
SerendipityHQ\Bundle\FeaturesBundle\Service\FeaturesManager
The text was updated successfully, but these errors were encountered:
No branches or pull requests
This code once was in
SerendipityHQ\Bundle\FeaturesBundle\Service\FeaturesManager
.Removed because it causes troubles when applying Rector and PHP CS Fixer.
The text was updated successfully, but these errors were encountered: