当前位置: 首页>>代码示例>>PHP>>正文


PHP CmsUser::setEmail方法代码示例

本文整理汇总了PHP中Doctrine\Tests\Models\CMS\CmsUser::setEmail方法的典型用法代码示例。如果您正苦于以下问题:PHP CmsUser::setEmail方法的具体用法?PHP CmsUser::setEmail怎么用?PHP CmsUser::setEmail使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Doctrine\Tests\Models\CMS\CmsUser的用法示例。


在下文中一共展示了CmsUser::setEmail方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: loadFixtures

 private function loadFixtures()
 {
     $u1 = new CmsUser();
     $u2 = new CmsUser();
     $u3 = new CmsUser();
     $u1->setEmail(new CmsEmail());
     $u1->setAddress(new CmsAddress());
     $u1->addPhonenumber(new CmsPhonenumber());
     $u2->setEmail(new CmsEmail());
     $u2->setAddress(new CmsAddress());
     $u2->addPhonenumber(new CmsPhonenumber());
     $u2->addPhonenumber(new CmsPhonenumber());
     $u3->setEmail(new CmsEmail());
     $u3->setAddress(new CmsAddress());
     $u3->addPhonenumber(new CmsPhonenumber());
     $u3->addPhonenumber(new CmsPhonenumber());
     $u3->addPhonenumber(new CmsPhonenumber());
     $u1->name = 'Test 1';
     $u1->username = '1test';
     $u1->status = 'developer';
     $u1->email->email = 'email@test1.com';
     $u1->address->zip = '111111111';
     $u1->address->city = 'Some City 1';
     $u1->address->country = 'Some Country 2';
     $u1->phonenumbers[0]->phonenumber = "(11) 1111-1111";
     $u2->name = 'Test 2';
     $u2->username = '2test';
     $u2->status = 'developer';
     $u2->email->email = 'email@test2.com';
     $u2->address->zip = '222222222';
     $u2->address->city = 'Some City 2';
     $u2->address->country = 'Some Country 2';
     $u2->phonenumbers[0]->phonenumber = "(22) 1111-1111";
     $u2->phonenumbers[1]->phonenumber = "(22) 2222-2222";
     $u3->name = 'Test 3';
     $u3->username = '3test';
     $u3->status = 'developer';
     $u3->email->email = 'email@test3.com';
     $u3->address->zip = '33333333';
     $u3->address->city = 'Some City 3';
     $u3->address->country = 'Some Country 3';
     $u3->phonenumbers[0]->phonenumber = "(33) 1111-1111";
     $u3->phonenumbers[1]->phonenumber = "(33) 2222-2222";
     $u3->phonenumbers[2]->phonenumber = "(33) 3333-3333";
     $this->_em->persist($u1);
     $this->_em->persist($u2);
     $this->_em->persist($u3);
     $this->_em->flush();
     $this->_em->clear();
     $this->fixtures = array($u1, $u2, $u3);
 }
开发者ID:pnaq57,项目名称:zf2demo,代码行数:51,代码来源:NewOperatorTest.php

示例2: testGivenOrphanRemovalOneToOne_WhenReplacing_ThenNoUniqueConstraintError

 public function testGivenOrphanRemovalOneToOne_WhenReplacing_ThenNoUniqueConstraintError()
 {
     $user = new CmsUser();
     $user->name = "Benjamin";
     $user->username = "beberlei";
     $user->status = "something";
     $user->setEmail($email = new CmsEmail());
     $email->setEmail("kontakt@beberlei.de");
     $this->_em->persist($user);
     $this->_em->flush();
     $this->assertTrue($this->_em->contains($email));
     $user->setEmail($newEmail = new CmsEmail());
     $newEmail->setEmail("benjamin.eberlei@googlemail.com");
     $this->_em->flush();
     $this->assertFalse($this->_em->contains($email));
 }
开发者ID:Herriniaina,项目名称:iVarotra,代码行数:16,代码来源:DDC1666Test.php

示例3: testOrphanRemovalWhenUnlink

 public function testOrphanRemovalWhenUnlink()
 {
     $user = new CmsUser();
     $user->status = 'dev';
     $user->username = 'beberlei';
     $user->name = 'Bejamin Eberlei';
     $email = new CmsEmail();
     $email->email = 'beberlei@domain.com';
     $user->setEmail($email);
     $this->_em->persist($user);
     $this->_em->flush();
     $userId = $user->getId();
     $this->_em->clear();
     $user = $this->_em->find('Doctrine\\Tests\\Models\\CMS\\CmsUser', $userId);
     $user->setEmail(null);
     $this->_em->persist($user);
     $this->_em->flush();
     $this->_em->clear();
     $query = $this->_em->createQuery('SELECT e FROM Doctrine\\Tests\\Models\\CMS\\CmsEmail e');
     $result = $query->getResult();
     $this->assertEquals(0, count($result), 'CmsEmail should be removed by orphanRemoval');
 }
开发者ID:ncking,项目名称:doctrine2,代码行数:22,代码来源:OneToOneOrphanRemovalTest.php

示例4: testBasicNativeNamedQueryWithResultClass

 /**
  * @group DDC-1663
  */
 public function testBasicNativeNamedQueryWithResultClass()
 {
     $user = new CmsUser();
     $user->name = 'Fabio B. Silva';
     $user->username = 'FabioBatSilva';
     $user->status = 'dev';
     $email = new CmsEmail();
     $email->email = 'fabio.bat.silva@gmail.com';
     $user->setEmail($email);
     $this->_em->clear();
     $this->_em->persist($user);
     $this->_em->flush();
     $this->_em->clear();
     $repository = $this->_em->getRepository('Doctrine\\Tests\\Models\\CMS\\CmsUser');
     $result = $repository->createNativeNamedQuery('fetchIdAndUsernameWithResultClass')->setParameter(1, 'FabioBatSilva')->getResult();
     $this->assertEquals(1, count($result));
     $this->assertInstanceOf('Doctrine\\Tests\\Models\\CMS\\CmsUser', $result[0]);
     $this->assertNull($result[0]->name);
     $this->assertNull($result[0]->email);
     $this->assertEquals($user->id, $result[0]->id);
     $this->assertEquals('FabioBatSilva', $result[0]->username);
     $this->_em->clear();
     $result = $repository->createNativeNamedQuery('fetchAllColumns')->setParameter(1, 'FabioBatSilva')->getResult();
     $this->assertEquals(1, count($result));
     $this->assertInstanceOf('Doctrine\\Tests\\Models\\CMS\\CmsUser', $result[0]);
     $this->assertEquals($user->id, $result[0]->id);
     $this->assertEquals('Fabio B. Silva', $result[0]->name);
     $this->assertEquals('FabioBatSilva', $result[0]->username);
     $this->assertEquals('dev', $result[0]->status);
     $this->assertInstanceOf('Doctrine\\Tests\\Models\\CMS\\CmsEmail', $result[0]->email);
 }
开发者ID:relo-san,项目名称:doctrine2,代码行数:34,代码来源:NativeQueryTest.php

示例5: loadFixtureUserEmail

 public function loadFixtureUserEmail()
 {
     $user1 = new CmsUser();
     $user2 = new CmsUser();
     $user3 = new CmsUser();
     $email1 = new CmsEmail();
     $email2 = new CmsEmail();
     $email3 = new CmsEmail();
     $user1->name = 'Test 1';
     $user1->username = 'test1';
     $user1->status = 'active';
     $user2->name = 'Test 2';
     $user2->username = 'test2';
     $user2->status = 'active';
     $user3->name = 'Test 3';
     $user3->username = 'test3';
     $user3->status = 'active';
     $email1->email = 'test1@test.com';
     $email2->email = 'test2@test.com';
     $email3->email = 'test3@test.com';
     $user1->setEmail($email1);
     $user2->setEmail($email2);
     $user3->setEmail($email3);
     $this->_em->persist($user1);
     $this->_em->persist($user2);
     $this->_em->persist($user3);
     $this->_em->persist($email1);
     $this->_em->persist($email2);
     $this->_em->persist($email3);
     $this->_em->flush();
     $this->_em->clear();
     return array($user1, $user2, $user3);
 }
开发者ID:selimcr,项目名称:servigases,代码行数:33,代码来源:EntityRepositoryTest.php

示例6: loadFixture

 private function loadFixture()
 {
     $user = new CmsUser();
     $user->name = 'Roman';
     $user->username = 'romanb';
     $user->status = 'developer';
     $address = new CmsAddress();
     $address->country = 'Germany';
     $address->city = 'Berlin';
     $address->zip = '12345';
     $user->setAddress($address);
     $email = new CmsEmail();
     $email->setEmail('roman@domain.com');
     $user->setEmail($email);
     $ph1 = new CmsPhonenumber();
     $ph1->phonenumber = "0301234";
     $ph2 = new CmsPhonenumber();
     $ph2->phonenumber = "987654321";
     $user->addPhonenumber($ph1);
     $user->addPhonenumber($ph2);
     $this->_em->persist($user);
     $this->_em->flush();
     $this->userId = $user->getId();
     $this->_em->clear();
 }
开发者ID:selimcr,项目名称:servigases,代码行数:25,代码来源:PostLoadEventTest.php


注:本文中的Doctrine\Tests\Models\CMS\CmsUser::setEmail方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。