private function createUser() { $riaUser = new User(); $riaUser->setUsername('ria'); $riaUser->setEmail('*****@*****.**'); $riaUser->setPlainPassword('ria'); $riaUser->setEnabled(true); $riaUser->setRoles(array('ROLE_RIA')); $riaUserProfile = new Profile(); $riaUserProfile->setUser($riaUser); $riaUserProfile->setCompany('Wealthbot'); $riaUserProfile->setFirstName('RiaFirst'); $riaUserProfile->setLastName('RiaLast'); $riaUserProfile->setRegistrationStep(5); $riaUser->setProfile($riaUserProfile); return $riaUser; }
private function createUser(User $riaUser) { $clientUser = new User(); $clientUser->setUsername('client'); $clientUser->setEmail('*****@*****.**'); $clientUser->setPlainPassword('client'); $clientUser->setEnabled(true); $clientUser->setRoles(array('ROLE_CLIENT')); $clientUserProfile = new Profile(); $clientUserProfile->setUser($clientUser); $clientUserProfile->setFirstName('ClientFirst'); $clientUserProfile->setLastName('ClientLast'); $clientUserProfile->setMiddleName('C'); $clientUserProfile->setRegistrationStep(3); $clientUserProfile->setRia($riaUser); $clientUserProfile->setStatusProspect(); $clientUser->setProfile($clientUserProfile); $clientSettings = new ClientSettings(); $clientUser->setClientSettings($clientSettings); $clientSettings->setClient($clientUser); return $clientUser; }
private function createClientUser(array $data, User $riaUser) { $clientUser = new User(); $clientUser->setUsername($data['username']); $clientUser->setEmail($data['username']); $clientUser->setPlainPassword($data['password']); $clientUser->setEnabled(true); $clientUser->setRoles(array('ROLE_CLIENT')); $clientUserProfile = new Profile(); $clientUserProfile->setUser($clientUser); $clientUserProfile->setRia($riaUser); $clientUserProfile->setFirstName($data['first_name']); $clientUserProfile->setLastName($data['last_name']); $clientUserProfile->setState($this->getReference('state-' . $data['state'])); $clientUserProfile->setStreet($data['street']); $clientUserProfile->setCity($data['city']); $clientUserProfile->setZip($data['zip']); $clientUserProfile->setBirthDate(new \DateTime($data['birth_date'])); $clientUserProfile->setPhoneNumber($data['phone_number']); $clientUserProfile->setMaritalStatus($data['marital_status']); $clientUserProfile->setAnnualIncome($data['annual_income']); $clientUserProfile->setEstimatedIncomeTax($data['estimated_income_tax']); $clientUserProfile->setLiquidNetWorth($data['liquid_net_worth']); $clientUserProfile->setEmploymentType($data['employment_type']); $clientUserProfile->setClientAccountManaged($data['client_account_managed']); $clientUserProfile->setRegistrationStep($data['registration_step']); $clientSettings = new ClientSettings(); $clientSettings->setStopTlhValue($data['stop_tlh_value']); $clientUser->setClientSettings($clientSettings); $clientSettings->setClient($clientUser); //$clientUserProfile->setSuggestedPortfolio($this->getReference('cec-ria-model-' . $data['suggested_portfolio_index'])); if (isset($data['client_status'])) { $clientUserProfile->setClientStatus($data['client_status']); } $clientUser->setProfile($clientUserProfile); if (isset($data['created'])) { $createdAt = new \DateTime($data['created']); $clientUser->setCreated($createdAt); } if (isset($data['paymentMethod'])) { $clientUser->getProfile()->setPaymentMethod($data['paymentMethod']); } return $clientUser; }