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


PHP User::setPassword方法代码示例

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


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

示例1: testDetach

 public function testDetach()
 {
     $user = new User();
     $user->setUsername('jon');
     $user->setPassword('changeme');
     $this->dm->persist($user);
     $this->dm->flush();
     $user->setUsername('whoop');
     $this->dm->detach($user);
     $this->dm->flush();
     $this->dm->clear();
     $user2 = $this->dm->find('Documents\\User', $user->getId());
     $this->assertEquals('jon', $user2->getUsername());
 }
开发者ID:poulikov,项目名称:mongodb-odm,代码行数:14,代码来源:PersistingTest.php

示例2: testRemove

 public function testRemove()
 {
     $account = new Account();
     $account->setName('Jon Test Account');
     $user = new User();
     $user->setUsername('jon');
     $user->setPassword('changeme');
     $user->setAccount($account);
     $this->dm->persist($user);
     $this->dm->flush();
     $this->dm->remove($user);
     $this->dm->flush();
     $account = $this->dm->find('Documents\\Account', $account->getId());
     $this->assertNull($account);
     $user = $this->dm->find('Documents\\User', $user->getId());
     $this->assertNull($user);
 }
开发者ID:Wizkunde,项目名称:mongodb-odm,代码行数:17,代码来源:RemoveTest.php

示例3: testReplaceEntireGroupsArray

 public function testReplaceEntireGroupsArray()
 {
     $account = new Account();
     $account->setName('Jon Test Account');
     $user = new User();
     $user->setUsername('jon333');
     $user->setPassword('changeme');
     $user->setAccount($account);
     $group2 = new Group('member');
     $user->addGroup(new Group('administrator'));
     $user->addGroup($group2);
     $user->addGroup(new Group('moderator'));
     $this->dm->persist($user);
     $this->dm->flush();
     $this->dm->clear();
     $user = $this->dm->find('Documents\\User', $user->getId());
     $this->assertNotNull($user);
     // Issue is collection must be initialized
     $groups = $user->getGroups();
     $groups[0];
     // initialize collection
     // reffectively remove two of the groups
     //$user->getGroups()->clear();
     //$user->getGroups()->add($group2);
     $user->setGroups(array($group2));
     $this->assertEquals(1, count($user->getGroups()));
     $this->dm->flush();
     $this->dm->clear();
     $user = $this->dm->find('Documents\\User', $user->getId());
     $this->assertEquals(1, count($user->getGroups()));
 }
开发者ID:im286er,项目名称:ent,代码行数:31,代码来源:FunctionalTest.php

示例4: testReplaceGroups

 public function testReplaceGroups()
 {
     $this->dm->getUnitOfWork()->setDocumentPersister('Documents\\User', new BasicDocumentPersister($this->dm, $this->classMetadata));
     $account = new Account();
     $account->setName('Jon Test Account');
     $user = new User();
     $user->setUsername('jon');
     $user->setPassword('changeme');
     $user->setAccount($account);
     $user->addGroup(new Group('administrator'));
     $user->addGroup(new Group('member'));
     $user->addGroup(new Group('moderator'));
     $this->dm->persist($user);
     $this->dm->flush();
     $this->dm->clear();
     unset($user, $account);
     $user = $this->dm->findOne('Documents\\User');
     $user->removeGroup('moderator');
     $user->removeGroup('member');
     $this->assertEquals(1, count($user->getGroups()));
     $user->addGroup(new Group('seller'));
     $user->addGroup(new Group('supplier'));
     $this->assertEquals(3, count($user->getGroups()));
     $this->dm->getUnitOfWork()->setDocumentPersister('Documents\\User', $this->persister);
     $this->persister->expects($this->once())->method('update')->with($user);
     $this->dm->getUnitOfWork()->computeChangeSets();
     $update = $this->persister->prepareUpdateData($user);
     $this->assertFalse(array_key_exists('$set', $update));
     $this->assertFalse(array_key_exists('$unset', $update));
     $this->assertTrue(array_key_exists('$pullAll', $update));
     $this->assertTrue(array_key_exists('groups', $update['$pullAll']));
     $this->assertEquals(2, count($update['$pullAll']['groups']));
     $this->assertTrue(array_key_exists('$pushAll', $update));
     $this->assertTrue(array_key_exists('groups', $update['$pushAll']));
     $this->assertEquals(2, count($update['$pushAll']['groups']));
     $this->dm->flush();
     $this->dm->clear();
     unset($user);
     $user = $this->dm->findOne('Documents\\User');
     $this->assertEquals(3, count($user->getGroups()));
 }
开发者ID:poulikov,项目名称:mongodb-odm,代码行数:41,代码来源:BasicDocumentPersisterTest.php

示例5: testFindUser

 public function testFindUser()
 {
     $account = new Account();
     $account->setName('Jon Test Account');
     $user1 = new CustomUser();
     $user1->setId('userId');
     $user1->setUsername('user1');
     $user1->setPassword('changeme');
     $user1->setAccount($account);
     $user2 = new User();
     $user2->setUsername('user2');
     $user2->setPassword('changeme');
     $user2->setAccount($account);
     $user3 = new User();
     $user3->setUsername('user3');
     $user3->setPassword('changeme');
     $user3->setAccount($account);
     $this->dm->persist($user1);
     $this->dm->persist($user2);
     $this->dm->persist($user3);
     $this->dm->flush();
     $this->dm->clear();
     unset($user1, $user2, $user3);
     $user = $this->dm->find('Documents\\CustomUser', 'userId');
     $this->assertNotNull($user);
     $this->assertEquals('userId', $user->getId());
     $this->assertEquals('user1', $user->getUsername());
     $this->dm->clear();
     unset($user);
     $this->assertNull($this->dm->find('Documents\\User', 'userId'));
     $this->assertNull($this->dm->find('Documents\\CustomUser', 'asd'));
 }
开发者ID:alcaeus,项目名称:mongodb-odm,代码行数:32,代码来源:CustomIdTest.php

示例6: Configuration

$classLoader->register();
$config = new Configuration();
/*
$config->setLoggerCallable(function(array $log) {
    print_r($log);
});
$config->setMetadataCacheImpl(new ApcCache());
*/
$config->setProxyDir(__DIR__ . '/Proxies');
$config->setProxyNamespace('Proxies');
$reader = new AnnotationReader();
$reader->setDefaultAnnotationNamespace('Doctrine\\ODM\\MongoDB\\Mapping\\');
$config->setMetadataDriverImpl(new AnnotationDriver($reader, __DIR__ . '/Documents'));
//$config->setMetadataDriverImpl(new XmlDriver(__DIR__ . '/xml'));
//$config->setMetadataDriverImpl(new YamlDriver(__DIR__ . '/yaml'));
//$config->setMetadataDriverImpl(new PHPDriver());
$dm = DocumentManager::create(new Mongo(), $config);
$profile = new Profile();
$profile->setName('Jonathan H. Wage');
$profile->addSong(new Song('Testinfuckckcg'));
$user = new User();
$user->setUsername('jwage');
$user->setPassword('changeme');
$user->addPhonenumber(new Phonenumber('6155139185'));
$user->setProfile($profile);
$configuration = new ConfigurationDoc();
$configuration->setTimezone('Eastern');
$configuration->setTheme('doctrine');
$user->setConfiguration($configuration);
$dm->persist($user);
$dm->flush();
开发者ID:jacques-sounvi,项目名称:addressbook,代码行数:31,代码来源:example.php

示例7: setPassword

 public function setPassword($value)
 {
     $this->__load();
     return parent::setPassword($value);
 }
开发者ID:ud223,项目名称:yj,代码行数:5,代码来源:__CG__DocumentsUser.php


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