當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。