コード例 #1
0
ファイル: LoadMemberData.php プロジェクト: AnkaraPHP/pheetup
 public function load(ObjectManager $om)
 {
     $om->clear();
     $member = new Member();
     $member->setUsername("delirehberi")->setEmail("*****@*****.**")->setEnabled(TRUE)->setExpired(FALSE);
     $member->setFirstName("Emre")->setLastName("YILMAZ")->setLocked(FALSE)->setPassword("null")->setSuperAdmin(TRUE)->setEmailCanonical("*****@*****.**")->setUsernameCanonical("delirehberi");
     $this->addReference('member-delirehberi', $member);
     $om->persist($member);
     $dir = dirname(dirname(__DIR__)) . '/Media/';
     copy($dir . 'test.jpg', $dir . 'test1.jpg');
     $logo = new UploadedFile($dir . 'test1.jpg', 'test.jpg', 'image/jpeg', 115671, null, true);
     $group = new Group("AnkaraPHP");
     $group->setDomain("ankaraphp");
     $group->setDescription("Ankaradaki Php geliştiricilerinin toplandığı bir grup");
     $group->setLocation("Ankara/Turkey");
     $group->setLogo($logo);
     $this->addReference('group-ankaraphp', $group);
     $om->persist($group);
     $om->flush();
 }
コード例 #2
0
 /**
  * @Route("/{domain}")
  * @ParamConverter("group",class="PheetupUserBundle:Group")
  */
 public function groupAction(Group $group)
 {
     $events = $group->getEvents();
     return $this->render('@PheetupSite/Default/group.html.twig', ['events' => $events]);
 }