public function getPackagesInfo(Subscription $subscription)
 {
     $isCommercialAccount = $subscription->getGroup() && $subscription->getGroup()->isCommercial();
     $memberCount = 0;
     if ($subscription->getGroup()) {
         $memberCount = $this->em->getRepository(Group::class)->getTotalMembers($subscription->getGroup());
     }
     return [Subscription::PACKAGE_TYPE_FREE => ['title' => Subscription::$labels[Subscription::PACKAGE_TYPE_FREE], 'price' => $this->prices[Subscription::PACKAGE_TYPE_FREE], 'isBuyAvailable' => false], Subscription::PACKAGE_TYPE_SILVER => ['title' => Subscription::$labels[Subscription::PACKAGE_TYPE_SILVER], 'price' => $this->prices[Subscription::PACKAGE_TYPE_SILVER], 'isBuyAvailable' => $subscription->getPackageType() <= Subscription::PACKAGE_TYPE_SILVER && !$isCommercialAccount && $memberCount < $this->createPackageObject($subscription::PACKAGE_TYPE_SILVER)->getGroupSizeLimitation()], Subscription::PACKAGE_TYPE_GOLD => ['title' => Subscription::$labels[Subscription::PACKAGE_TYPE_GOLD], 'price' => $this->prices[Subscription::PACKAGE_TYPE_GOLD], 'isBuyAvailable' => $subscription->getPackageType() <= Subscription::PACKAGE_TYPE_GOLD && $memberCount < $this->createPackageObject($subscription::PACKAGE_TYPE_GOLD)->getGroupSizeLimitation()], Subscription::PACKAGE_TYPE_PLATINUM => ['title' => Subscription::$labels[Subscription::PACKAGE_TYPE_PLATINUM], 'price' => $this->prices[Subscription::PACKAGE_TYPE_PLATINUM], 'isBuyAvailable' => $subscription->getPackageType() <= Subscription::PACKAGE_TYPE_PLATINUM && !$isCommercialAccount], Subscription::PACKAGE_TYPE_COMMERCIAL => ['title' => Subscription::$labels[Subscription::PACKAGE_TYPE_COMMERCIAL], 'price' => $this->prices[Subscription::PACKAGE_TYPE_COMMERCIAL], 'isBuyAvailable' => false]];
 }
 public function getPackageType()
 {
     $this->__load();
     return parent::getPackageType();
 }