本文整理汇总了PHP中Symfony\Component\Security\Core\User\UserInterface::getType方法的典型用法代码示例。如果您正苦于以下问题:PHP UserInterface::getType方法的具体用法?PHP UserInterface::getType怎么用?PHP UserInterface::getType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symfony\Component\Security\Core\User\UserInterface
的用法示例。
在下文中一共展示了UserInterface::getType方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getSubscription
/**
* @param UserInterface $user
* @return Subscription
*/
public function getSubscription(UserInterface $user)
{
$subscription = $this->em->getRepository(Subscription::class)->findOneBy([$user->getType() => $user]);
if (!$subscription) {
$subscription = new Subscription();
$subscription->setPackageType(Subscription::PACKAGE_TYPE_FREE)->setUserEntity($user);
} else {
if ($subscription->isSyncNeeded()) {
return $this->stripe->syncSubscription($subscription);
}
}
return $subscription;
}
示例2: getNewPaymentRequestsQuery
public function getNewPaymentRequestsQuery(UserInterface $user)
{
$className = ucfirst($user->getType()) . 'PaymentRequest';
return $this->getEntityManager()->createQueryBuilder()->select('pr')->from("CivixCoreBundle:Poll\\Question\\{$className}", 'pr')->where('pr.publishedAt IS NULL')->andWhere('pr.user = :userId')->setParameter('userId', $user->getId())->orderBy('pr.createdAt', 'DESC')->getQuery();
}
示例3: getCustomerClass
private function getCustomerClass(UserInterface $user)
{
return '\\Civix\\CoreBundle\\Entity\\Customer\\Customer' . ucfirst($user->getType());
}
示例4: isEqualTo
public function isEqualTo(UserInterface $user)
{
if (!$user instanceof HybridUser) {
return false;
}
if ($this->username !== $user->getUsername()) {
return false;
}
if ($this->type !== $user->getType()) {
return false;
}
if ($this->id !== $user->getId()) {
return false;
}
return true;
}