public function __construct(UserInterface $user) { $this->userId = $user->getId(); $this->userType = $user->getType(); $this->createdAt = new \DateTime(); $this->generateToken(); }
/** * Compare users * * @param UserInterface $user * * @return Bool */ public function equals(UserInterface $user) { return md5($this->getUsername()) == md5($user->getUsername()); }
public static function getEntityClassByUser(UserInterface $user) { $type = ucfirst($user->getType()); return "Civix\\CoreBundle\\Entity\\Stripe\\Account{$type}"; }
/** * @param UserInterface $entity * @return $this */ public function setUserEntity(UserInterface $entity) { $method = 'set' . ucfirst($entity->getType()); $this->{$method}($entity); return $this; }
private function getAppearsOnStatement(UserInterface $user) { if ($user instanceof Group) { return $user->getAcronym() ?: mb_substr($user->getOfficialName(), 0, 5); } return 'PowerlineAppPay'; }