本文整理汇总了PHP中AppBundle\Entity\User::setPicturePath方法的典型用法代码示例。如果您正苦于以下问题:PHP User::setPicturePath方法的具体用法?PHP User::setPicturePath怎么用?PHP User::setPicturePath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AppBundle\Entity\User
的用法示例。
在下文中一共展示了User::setPicturePath方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: injectUser
protected function injectUser()
{
$this->user = new User();
//$admin = 'tester'; // MWAHAHAHA
//$departmentId = 5; // UiB
$role = $this->em->getRepository('AppBundle:Role')->findOneByRole('ROLE_USER');
$this->user->addRole($role);
$this->user->setGender(1);
$this->user->setFirstName("Shi");
$this->user->setLastName("LaLong");
$emd = $this->em->getRepository('AppBundle:FieldOfStudy')->find(40);
// Tuple "Andre" from UiB, id 40 for fos
$this->user->setFieldOfStudy($emd);
$this->user->setUserName("shiluib");
// Weird typo?
$this->user->setEmail("shiluib@student.uib.no");
$this->user->setPhone("47661674");
$this->user->setPicturePath("images/defaultProfile.png");
$this->user->setPassword("pimwrneil");
$createNewUserCode = bin2hex(openssl_random_pseudo_bytes(16));
$hashedNewUserCode = hash('sha512', $createNewUserCode, false);
$this->user->setNewUserCode($hashedNewUserCode);
// Persist the user
$this->user->setIsActive(1);
$this->em->persist($this->user);
$this->em->flush();
return $this;
}
示例2: load
public function load(ObjectManager $manager)
{
$user1 = new User();
$user1->setIsActive('1');
$user1->setEmail('petter@stud.ntnu.no');
$user1->setFirstName('Petter');
$user1->setLastName('Johansen');
$user1->setGender('0');
$user1->setPhone('95347865');
$user1->setUserName('petjo');
$user1->setPassword('1234');
$user1->addRole($this->getReference('role-4'));
$user1->setFieldOfStudy($this->getReference('fos-1'));
$user1->setPicturePath('images/defaultProfile.png');
$manager->persist($user1);
$user2 = new User();
$user2->setIsActive('1');
$user2->setEmail('ida@stud.ntnu.no');
$user2->setFirstName('Ida');
$user2->setLastName('Andreassen');
$user2->setGender('1');
$user2->setPhone('95267841');
$user2->setUserName('idaan');
$user2->setPassword('1234');
$user2->addRole($this->getReference('role-1'));
$user2->setFieldOfStudy($this->getReference('fos-2'));
$user2->setPicturePath('images/defaultProfile.png');
$manager->persist($user2);
$user3 = new User();
$user3->setIsActive('1');
$user3->setEmail('kristoffer@stud.ntnu.no');
$user3->setFirstName('Kristoffer');
$user3->setLastName('Bø');
$user3->setGender('0');
$user3->setPhone('95148725');
$user3->setUserName('kribo');
$user3->setPassword('1234');
$user3->addRole($this->getReference('role-1'));
$user3->setFieldOfStudy($this->getReference('fos-3'));
$user3->setPicturePath('images/defaultProfile.png');
$manager->persist($user3);
$user4 = new User();
$user4->setIsActive('1');
$user4->setEmail('alm@mail.com');
$user4->setFirstName('Thomas');
$user4->setLastName('Alm');
$user4->setGender('0');
$user4->setPhone('12312312');
$user4->setUserName('thomas');
$user4->setPassword('123');
$user4->addRole($this->getReference('role-1'));
$user4->setFieldOfStudy($this->getReference('fos-1'));
$user4->setPicturePath('images/defaultProfile.png');
$manager->persist($user4);
$user5 = new User();
$user5->setIsActive('1');
$user5->setEmail('a@b.c');
$user5->setFirstName('Reidun');
$user5->setLastName('Persdatter Ødegaard');
$user5->setGender('1');
$user5->setPhone('92269548');
$user5->setUserName('reidun');
$user5->setPassword('123');
$user5->addRole($this->getReference('role-4'));
$user5->setFieldOfStudy($this->getReference('fos-1'));
$user5->setPicturePath('images/defaultProfile.png');
$manager->persist($user5);
$user6 = new User();
$user6->setIsActive('1');
$user6->setEmail('b@b.c');
$user6->setFirstName('Siri');
$user6->setLastName('Brenna Eskeland');
$user6->setGender('1');
$user6->setPhone('99540025');
$user6->setUserName('siri');
$user6->setPassword('123');
$user6->addRole($this->getReference('role-4'));
$user6->setFieldOfStudy($this->getReference('fos-1'));
$user6->setPicturePath('images/defaultProfile.png');
$manager->persist($user6);
$user7 = new User();
$user7->setIsActive('1');
$user7->setEmail('c@b.c');
$user7->setFirstName('Eirik');
$user7->setLastName('Myrvoll-Nilsen');
$user7->setGender('0');
$user7->setPhone('93093824');
$user7->setUserName('eirik');
$user7->setPassword('123');
$user7->addRole($this->getReference('role-2'));
$user7->setFieldOfStudy($this->getReference('fos-1'));
$user7->setPicturePath('images/defaultProfile.png');
$manager->persist($user7);
$user8 = new User();
$user8->setIsActive('1');
$user8->setEmail('d@b.c');
$user8->setFirstName('Ruben');
$user8->setLastName('Ravnå');
$user8->setGender('0');
$user8->setPhone('98059155');
//.........这里部分代码省略.........
示例3: testSetPicturePath
public function testSetPicturePath()
{
// new entity
$user = new User();
// Use the setPicturePath method
$user->setPicturePath("olsen.jpg");
// Assert the result
$this->assertEquals("olsen.jpg", $user->getPicturePath());
}
示例4: getTop
public function getTop()
{
/**
* @TODO: FIX IT
* I don't know WHY but I couldn't add the upvoteTotal in the UserEntity...
* THUS, I have done a workaround thought out RAW SQL
*/
$result = $this->repository->getTop();
$data = array();
foreach ($result as $row) {
$user = new User();
$user->setId($row['id']);
$user->setFirstname($row['firstname']);
$user->setLastname($row['lastname']);
$user->setUsername($row['username']);
$user->setPicturePath($row['picture_path']);
$user->setUpvoteTotal($row['upvote_total']);
$data[] = $user;
}
return $data;
}