<?php
namespace App\Object\Admin;
use Symfony\Component\Security\Core\User\UserInterface;
/**
* Class User.
*/
class User implements UserInterface
{
/**
* @var
*/
private $id;
/**
* @var
*/
private $login;
/**
* @var
*/
private $lastConnectionDate;
/**
* @var
*/
private $username;
/**
* @var
*/
private $email;
/**
* @var
*/
private $firstName;
/**
* @var
*/
private $lastName;
/**
* @var
*/
private $userParent;
/**
* @var array
*/
private array $roles = [];
/**
* @var
*/
private $password;
/**
* @var
*/
private $lastPasswordUpdateDate;
/**
* @var Customer
*/
private Customer $customer;
/**
* @var string
*/
private string $customerType;
/**
* @var
*/
private $customizations;
/**
* @var Role
*/
private Role $role;
/**
* @var
*/
private $ssoToken;
/**
* @var
*/
private $status;
/**
* @var
*/
private $privileges = [];
/**
* @var
*/
private $modules = [];
/**
* @var
*/
private $twoFactorAuth;
/**
* @var
*/
private $lastApiConnectionDate;
/**
* @var
*/
private int $unreadNotificationsCount;
private $lastLegacyApiConnectionDate;
private $widgets = [];
/**
* @return null|mixed
*/
public function getId(): mixed
{
return $this->id;
}
/**
* @param mixed $id
*
* @return $this
*/
public function setId($id): self
{
$this->id = $id;
return $this;
}
/**
* @param string $login
*
* @return $this
*/
public function setLogin(string $login): self
{
$this->login = $login;
return $this;
}
/**
* A visual identifier that represents this user.
*
* @see UserInterface
*/
public function getLogin(): string
{
return (string) $this->login;
}
/**
* @see UserInterface
*/
public function getLastConnectionDate(): ?string
{
return $this->lastConnectionDate;
}
/**
* @param string $lastConnectionDate
*
* @return $this
*/
public function setLastConnectionDate(?string $lastConnectionDate): self
{
$this->lastConnectionDate = $lastConnectionDate;
return $this;
}
/**
* @param string $username
*
* @return $this
*/
public function setUsername(string $username): self
{
$this->username = $username;
return $this;
}
/**
* A visual identifier that represents this user.
*
* @see UserInterface
*/
public function getUsername(): string
{
return (string) $this->username;
}
/**
* @return null|string
*/
public function getEmail(): ?string
{
return $this->email;
}
/**
* @param string $email
*
* @return $this
*/
public function setEmail(string $email): self
{
$this->email = $email;
return $this;
}
public function getFirstName(): ?string
{
return $this->firstName;
}
/**
* @param null|string $firstName
*
* @return $this
*/
public function setFirstName(?string $firstName): self
{
$this->firstName = $firstName;
return $this;
}
public function getLastName(): ?string
{
return $this->lastName;
}
/**
* @param null|string $lastName
*
* @return $this
*/
public function setLastName(?string $lastName): self
{
$this->lastName = $lastName;
return $this;
}
/**
* @return null|array
*/
public function getUserParent(): ?array
{
return $this->userParent;
}
/**
* @param null|array $userParent
*
* @return $this
*/
public function setUserParent(?array $userParent): self
{
$this->userParent = $userParent;
return $this;
}
/**
* @param string $key
*
* @return null|string
*/
public function getUserParentValueByKey(string $key): ?string
{
return $this->userParent[$key] ?? null;
}
/**
* @see UserInterface
*/
public function getRoles(): array
{
$roles = $this->roles;
// guarantee every user at least has ROLE_USER
$roles[] = 'ROLE_USER';
return array_unique($roles);
}
/**
* @param array $roles
*
* @return $this
*/
public function setRoles(array $roles): self
{
$this->roles = $roles;
return $this;
}
/**
* @see UserInterface
*/
public function getPassword(): string
{
return (string) $this->password;
}
/**
* @param string $password
*
* @return $this
*/
public function setPassword(string $password): self
{
$this->password = $password;
return $this;
}
/**
* @see UserInterface
*
* @return null|string
*/
public function getLastPasswordUpdateDate(): ?string
{
return $this->lastPasswordUpdateDate;
}
/**
* @param string $lastPasswordUpdateDate
*
* @return $this
*/
public function setLastPasswordUpdateDate(?string $lastPasswordUpdateDate): self
{
$this->lastPasswordUpdateDate = $lastPasswordUpdateDate;
return $this;
}
/**
* @see UserInterface
*/
public function getSalt(): void
{
}
/**
* @see UserInterface
*/
public function eraseCredentials(): void
{
}
/**
* @return Customer
*/
public function getCustomer(): Customer
{
return $this->customer;
}
/**
* @param mixed $customer
*
* @return $this
*/
public function setCustomer($customer): self
{
$this->customer = $customer;
return $this;
}
public function getCustomerType(): ?string
{
return $this->customerType;
}
public function setCustomerType($customerType): self
{
$this->customerType = $customerType;
return $this;
}
public function getCustomizations(): ?array
{
return $this->customizations;
}
public function setCustomizations(?array $customizations): self
{
$this->customizations = $customizations;
return $this;
}
public function setCustomization($key, $val): ?array
{
$this->customizations[$key] = $val;
return $this->customizations;
}
public function getCustomization($key)
{
return $this->customizations[$key];
}
public function hasCustomization($key)
{
return isset($this->customizations[$key]);
}
public function removeCustomization($key): ?array
{
unset($this->customizations[$key]);
return $this->customizations;
}
/**
* @return Role
*/
public function getRole(): Role
{
return $this->role;
}
/**
* @param Role $role
*
* @return $this
*/
public function setRole(Role $role)
{
$this->role = $role;
return $this;
}
public function getSsoToken(): ?string
{
return $this->ssoToken;
}
public function setSsoToken(?string $ssoToken): self
{
$this->ssoToken = $ssoToken;
return $this;
}
public function getPrivileges(): ?array
{
return $this->privileges;
}
public function setPrivileges(?array $privileges): self
{
$this->privileges = $privileges;
return $this;
}
public function getModules(): ?array
{
return $this->modules;
}
public function setModules(?array $modules): self
{
$this->modules = $modules;
return $this;
}
public function getStatus(): ?bool
{
return $this->status;
}
public function setStatus(bool $status): self
{
$this->status = $status;
return $this;
}
/**
* @return null|string
*/
public function getTwoFactorAuth(): ?string
{
return $this->twoFactorAuth;
}
/**
* @param null|string $twoFactorAuth
*
* @return $this
*/
public function setTwoFactorAuth(?string $twoFactorAuth): self
{
$this->twoFactorAuth = $twoFactorAuth;
return $this;
}
/**
* @return null|string
*/
public function getApiLastConnectionDate(): ?string
{
return $this->lastApiConnectionDate;
}
/**
* @param string $lastApiConnectionDate
*
* @return $this
*/
public function setApiLastConnectionDate(?string $lastApiConnectionDate): self
{
$this->lastApiConnectionDate = $lastApiConnectionDate;
return $this;
}
public function getUnreadNotificationsCount(): int
{
return $this->unreadNotificationsCount;
}
public function setUnreadNotificationsCount(int $unreadNotificationsCount): self
{
$this->unreadNotificationsCount = $unreadNotificationsCount;
return $this;
}
public function hasUnreadNotifications(): bool
{
return $this->unreadNotificationsCount > 0;
}
public function getLegacyApiLastConnectionDate(): ?string
{
return $this->lastLegacyApiConnectionDate;
}
public function setLegacyApiLastConnectionDate(?string $lastLegacyApiConnectionDate): self
{
$this->lastLegacyApiConnectionDate = $lastLegacyApiConnectionDate;
return $this;
}
/**
* @return array
*/
public function getWidgets(): array
{
return $this->widgets;
}
/**
* @param array $widgets
*/
public function setWidgets(array $widgets): void
{
$this->widgets = $widgets;
}
}