Exemplo n.º 1
0
 /**
  * @param FormBuilderInterface $builder
  * @param array                $options
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $builder->add('system', 'choice', ['choices' => array_combine(Company::getSystemChoices(), Company::getSystemChoices())])->add('name')->add('contactName')->add('position')->add('address')->add('phone')->add('bankAccount')->add('bic')->add('correspondentAccount')->add('inn')->add('kpp');
 }
Exemplo n.º 2
0
 protected static function loadTestFixtures()
 {
     $userManager = self::getContainer()->get('fos_user.user_manager');
     $tokenManager = self::getContainer()->get('vifeed.user.wsse_token_manager');
     $em = self::getContainer()->get('doctrine.orm.entity_manager');
     /** @var User $user1 */
     $user1 = $userManager->createUser();
     $user1->setEmail('*****@*****.**')->setUsername('*****@*****.**')->setFirstName('aaa')->setSurname('bbb')->setPhone(123)->setBalance(100)->setEnabled(true)->setType(User::TYPE_ADVERTISER)->setPlainPassword('12345');
     $userManager->updateUser($user1);
     $tokenManager->createUserToken($user1->getId());
     /** @var User $user2 */
     $user2 = $userManager->createUser();
     $user2->setEmail('*****@*****.**')->setUsername('*****@*****.**')->setFirstName('aaa')->setSurname('bbb')->setPhone(123)->setBalance(100)->setEnabled(true)->setType(User::TYPE_PUBLISHER)->setPlainPassword('12345');
     $company = new Company();
     $company->setSystem('УСН')->setName('ООО компания')->setAddress('12345')->setBankAccount('12345')->setBic('12345')->setContactName('12345')->setCorrespondentAccount('12345')->setInn('12345')->setKpp('12345')->setPosition('12345')->setPhone('12345')->setIsApproved(true);
     $user2->setCompany($company);
     $em->persist($company);
     $userManager->updateUser($user2);
     $tokenManager->createUserToken($user2->getId());
     /** @var User $user3 */
     $user3 = $userManager->createUser();
     $user3->setEmail('*****@*****.**')->setUsername('*****@*****.**')->setFirstName('aaa')->setSurname('bbb')->setPhone(123)->setBalance(100)->setEnabled(true)->setType(User::TYPE_ADVERTISER)->setEmailConfirmed(true)->setPlainPassword('12345');
     $userManager->updateUser($user3);
     $tokenManager->createUserToken($user3->getId());
     /** @var User $user4 */
     $user4 = $userManager->createUser();
     $user4->setEmail('*****@*****.**')->setUsername('*****@*****.**')->setFirstName('aaa')->setSurname('bbb')->setPhone(123)->setBalance(100)->setEnabled(true)->setType(User::TYPE_ADVERTISER)->setPlainPassword('12345');
     $userManager->updateUser($user4);
     $tokenManager->createUserToken($user4->getId());
     $em->flush();
     return ['users' => [$user1, $user2, $user3, $user4]];
 }
Exemplo n.º 3
0
Arquivo: User.php Projeto: bzis/zomba
 /**
  * @param Company $company
  *
  * @return $this
  */
 public function setCompany(Company $company)
 {
     $this->company = $company;
     $company->setUser($this);
     return $this;
 }
Exemplo n.º 4
0
 protected static function loadTestFixtures()
 {
     $userManager = self::getContainer()->get('fos_user.user_manager');
     $tokenManager = self::getContainer()->get('vifeed.user.wsse_token_manager');
     /** @var User $user1 */
     $user1 = $userManager->createUser();
     $user1->setEmail('*****@*****.**')->setUsername('*****@*****.**')->setBalance(100)->setEnabled(true)->setType(User::TYPE_ADVERTISER)->setPlainPassword('12345');
     $userManager->updateUser($user1);
     $company1 = new Company();
     $company1->setSystem('УСН')->setName('ООО компания')->setAddress('12345')->setBankAccount('12345')->setBic('12345')->setContactName('12345')->setCorrespondentAccount('12345')->setInn('12345')->setKpp('12345')->setPosition('12345')->setPhone('12345')->setIsApproved(false);
     $company2 = new Company();
     $company2->setSystem('УСН')->setName('ООО компания2')->setAddress('12345')->setBankAccount('12345')->setBic('12345')->setContactName('12345')->setCorrespondentAccount('12345')->setInn('12345')->setKpp('12345')->setPosition('12345')->setPhone('12345')->setIsApproved(true);
     /** @var User $user2 */
     $user2 = $userManager->createUser();
     $user2->setEmail('*****@*****.**')->setUsername('*****@*****.**')->setBalance(100)->setEnabled(true)->setType(User::TYPE_ADVERTISER)->setPlainPassword('12345')->setCompany($company1);
     self::$em->persist($company1);
     $userManager->updateUser($user2);
     /** @var User $user3 */
     $user3 = $userManager->createUser();
     $user3->setEmail('*****@*****.**')->setUsername('*****@*****.**')->setBalance(100)->setEnabled(true)->setType(User::TYPE_ADVERTISER)->setPlainPassword('12345')->setCompany($company2);
     self::$em->persist($company2);
     $userManager->updateUser($user3);
     self::$em->flush();
     $tokenManager->createUserToken($user1->getId());
     $tokenManager->createUserToken($user2->getId());
     $tokenManager->createUserToken($user3->getId());
     return ['users' => [$user1, $user2, $user3]];
 }