Beispiel #1
0
 /**
  * @param string $key
  * @param Lead   $entity
  */
 public function fillEntityData($key, $entity)
 {
     $addressRepo = $this->templateManager->getEntityRepository('Oro\\Bundle\\AddressBundle\\Entity\\Address');
     $userRepo = $this->templateManager->getEntityRepository('Oro\\Bundle\\UserBundle\\Entity\\User');
     $customerRepo = $this->templateManager->getEntityRepository('OroCRM\\Bundle\\SalesBundle\\Entity\\B2bCustomer');
     $contactRepo = $this->templateManager->getEntityRepository('OroCRM\\Bundle\\ContactBundle\\Entity\\Contact');
     $channelRepo = $this->templateManager->getEntityRepository('OroCRM\\Bundle\\ChannelBundle\\Entity\\Channel');
     switch ($key) {
         case 'Jerry Coleman':
             $entity->setName('Oro Inc. Lead Name');
             $entity->setCompanyName('Oro Inc.');
             $entity->setOwner($userRepo->getEntity('John Doo'));
             $entity->setDataChannel($channelRepo->getEntity('B2b channel|b2b'));
             $entity->setCreatedAt(new \DateTime());
             $entity->setUpdatedAt(new \DateTime());
             $entity->setCustomer($customerRepo->getEntity('Jerry Coleman'));
             $entity->setContact($contactRepo->getEntity('Jerry Coleman'));
             $entity->setAddress($addressRepo->getEntity('Jerry Coleman'));
             $entity->setEmail('*****@*****.**');
             $entity->setNamePrefix('Mr.');
             $entity->setFirstName('Jerry');
             $entity->setLastName('Coleman');
             $entity->setNameSuffix('Jr.');
             $entity->setStatus(new LeadStatus('New'));
             $entity->setJobTitle('Manager');
             $entity->setPhoneNumber('585-255-1127');
             $entity->setWebsite('http://orocrm.com');
             $entity->setNumberOfEmployees(100);
             $entity->setIndustry('Internet');
             return;
     }
     parent::fillEntityData($key, $entity);
 }