public function testGetLowInvestmentMarket()
 {
     $modelLowMarketReturn = $this->portfolioInformation->getModel()->getLowMarketReturn();
     $lowInvestmentMarket = round($this->portfolioInformation->getInvestmentMarket() * ($modelLowMarketReturn ? $modelLowMarketReturn : 0.8), 2);
     $this->assertEquals($lowInvestmentMarket, $this->portfolioInformation->getLowInvestmentMarket(), 'Invalid low investment market for non qualified entities.');
     $this->portfolioInformation->setIsQualifiedModel(true);
     $lowInvestmentMarket = round($this->portfolioInformation->getInvestmentMarket() * ($modelLowMarketReturn ? $modelLowMarketReturn : 0.8), 2);
     $this->assertEquals($lowInvestmentMarket, $this->portfolioInformation->getLowInvestmentMarket(), 'Invalid low investment market qualified entities.');
 }
 public function getPortfolioInformation(User $user, CeModelInterface $model, $isQualified = false)
 {
     if ($user->hasRole('ROLE_CLIENT')) {
         $ria = $user->getRia();
     } else {
         $ria = $user;
     }
     $portfolioInformation = new PortfolioInformation();
     $portfolioInformation->setUser($user);
     $portfolioInformation->setModel($model);
     $portfolioInformation->setIsQualifiedModel($isQualified);
     $portfolioInformation->setFees($this->feeManager->getClientFees($ria));
     if ($model->getOwner()->hasRole('ROLE_RIA')) {
         $transactionCommissionFees = $this->em->getRepository('WealthbotAdminBundle:SecurityAssignment')->findMinAndMaxTransactionFeeForModel($model->getParentId());
         $portfolioInformation->setTransactionCommissionFees(array_values($transactionCommissionFees));
     }
     return $portfolioInformation;
 }