/** * Returns an instance of class * * @return MEMBERSHIP_BOL_MembershipPlanDao */ public static function getInstance() { if (self::$classInstance === null) { self::$classInstance = new self(); } return self::$classInstance; }
public function deleteMembershipTypeByRoleId($roleId) { $types = $this->membershipTypeDao->getTypeIdListByRoleId($roleId); if ($types) { foreach ($types as $typeId) { $this->membershipPlanDao->deletePlansByTypeId($typeId); } } $this->membershipTypeDao->deleteByRoleId($roleId); return true; }
public function deleteUserTrialsByTypeId($typeId) { if (!$typeId) { return true; } $plans = $this->membershipPlanDao->findPlanListByTypeId($typeId); if (!$plans) { return true; } foreach ($plans as $plan) { $this->membershipUserTrialDao->deleteByPlanId($plan->id); } return true; }