/**
  * Load data fixtures with the passed EntityManager
  *
  * @param \Doctrine\Common\Persistence\ObjectManager $manager
  */
 function load(ObjectManager $manager)
 {
     $custodian = new Custodian();
     $custodian->setName('TD Ameritrade');
     $custodian->setEmail('*****@*****.**');
     $this->addReference('custodian-td-ameritrade', $custodian);
     $manager->persist($custodian);
     $manager->flush();
 }
 /**
  * Returns array of custodian disclosure files links.
  * example: array('document_type' => array('title' => 'Disclosure', 'link' => 'CustodianDisclosure.pdf'))
  *
  * @param Custodian $custodian
  * @return array
  */
 public function getCustodianDisclosuresLinks(Custodian $custodian)
 {
     $custodianId = $custodian->getId();
     $custodianPrefix = str_replace(' ', '', $custodian->getName());
     $documents = $this->getCustodianDocuments($custodianId);
     $result = array();
     foreach ($documents as $type => $document) {
         $nameParams = explode('_', $type);
         foreach ($nameParams as &$param) {
             if ($param == 'ira') {
                 $param = strtoupper($param);
             } else {
                 $param = ucfirst($param);
             }
         }
         $linkTitle = implode(' ', $nameParams);
         $linkFileName = $custodianPrefix . '_' . str_replace(' ', '', $linkTitle) . '.pdf';
         $result[$type] = array('title' => $linkTitle, 'link' => $this->getCustodianDocumentLinkByType($custodianId, $type, $linkFileName));
     }
     return $result;
 }