本文整理汇总了PHP中Symfony\Component\Security\Acl\Domain\UserSecurityIdentity::getClass方法的典型用法代码示例。如果您正苦于以下问题:PHP UserSecurityIdentity::getClass方法的具体用法?PHP UserSecurityIdentity::getClass怎么用?PHP UserSecurityIdentity::getClass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symfony\Component\Security\Acl\Domain\UserSecurityIdentity
的用法示例。
在下文中一共展示了UserSecurityIdentity::getClass方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testConstructor
public function testConstructor()
{
$id = new UserSecurityIdentity('foo', 'Foo');
$this->assertEquals('foo', $id->getUsername());
$this->assertEquals('Foo', $id->getClass());
}
示例2: getUpdateUserSecurityIdentitySql
/**
* Constructs the SQL for updating a user security identity.
*
* @param UserSecurityIdentity $usid
* @param string $oldUsername
* @return string
*/
protected function getUpdateUserSecurityIdentitySql(UserSecurityIdentity $usid, $oldUsername)
{
if ($usid->getUsername() == $oldUsername) {
throw new \InvalidArgumentException('There are no changes.');
}
$oldIdentifier = $usid->getClass() . '-' . $oldUsername;
$newIdentifier = $usid->getClass() . '-' . $usid->getUsername();
return sprintf('UPDATE %s SET identifier = %s WHERE identifier = %s AND username = %s', $this->options['sid_table_name'], $this->connection->quote($newIdentifier), $this->connection->quote($oldIdentifier), $this->connection->getDatabasePlatform()->convertBooleans(true));
}
示例3: testConstructorWithProxy
public function testConstructorWithProxy()
{
$id = new UserSecurityIdentity('foo', 'Acme\\DemoBundle\\Proxy\\__CG__\\Symfony\\Component\\Security\\Tests\\Acl\\Domain\\Foo');
$this->assertEquals('foo', $id->getUsername());
$this->assertEquals('Acme\\DemoBundle\\Proxy\\__CG__\\Symfony\\Component\\Security\\Tests\\Acl\\Domain\\Foo', $id->getClass());
}