本文整理汇总了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);
}
示例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));
}
示例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');
}
示例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);
}
示例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);
}
示例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();
}