protected function buildModelForm(FormBuilderInterface $builder, User $ria)
 {
     $builder->add('client', new ChooseClientPortfolioFormType($this->clientPortfolio), array('mapped' => false, 'data' => $this->clientPortfolio->getClient()));
     if ($ria->getRiaCompanyInformation()->isCollaborativeProcessing()) {
         $builder->add('groups', 'entity', array('multiple' => false, 'property' => 'name', 'property_path' => 'user.groups', 'label' => 'Groups:', 'class' => 'Wealthbot\\UserBundle\\Entity\\Group', 'query_builder' => function (EntityRepository $er) use($ria) {
             return $er->createQueryBuilder('g')->andWhere('g.owner = :owner')->orWhere('g.owner is null')->setParameter('owner', $ria);
         }));
     }
 }
 public function getLatestValuesForPortfolio(ClientPortfolio $clientPortfolio)
 {
     return $this->repo->getLastValueByClient($clientPortfolio->getClient());
 }