/** * Get Trade Data for generate file * * @param RiaCompanyInformation $riaCompanyInformation * @param array $clientValuesIds * @return TradeData[] */ public function getTradeDataCollection(RiaCompanyInformation $riaCompanyInformation, array $clientValuesIds) { if ($riaCompanyInformation->isHouseholdManagedLevel()) { $tradeDataArray = $this->repository->findTradeDataArrayForClientPortfolioValuesIds($clientValuesIds); } else { $tradeDataArray = $this->repository->findTradeDataArrayForClientAccountValuesIds($clientValuesIds); } $tradeDataCollection = array(); foreach ($tradeDataArray as $data) { $tradeData = new TradeData(); $tradeData->loadFromArray($data); if (RebalancerQueue::STATUS_SELL === $tradeData->getAction()) { $vsps = $this->repository->findVSPForTradeData($tradeData); $tradeData->setVsps($vsps); } $tradeDataCollection[] = $tradeData; } return $tradeDataCollection; }