class UserManager implements UserManagerInterface, BasicEntityManagerInterface, JQGridInterface

Class UserManager is injected as alligator.user_manager service. UserManager handles the logic for managed entity.

Traits

Trait JQGridManagerTrait

Constants

USER_MAIL_TEMPLATE

Properties

protected UserRepository $repository
protected UserEventContainer $eventContainer

Methods

mixed
searchForJQGRID(array $searchParams, array $sortParams = array(), array $additionalParams = array(), JQGridWrapper $jqGridWrapper = null)

No description

mixed
findAllForJQGRID(int $page, int $offset, array $sortParams, array $additionalParams = array(), JQGridWrapper $jqGridWrapper = null)

No description

array
getCountForJQGRID(null $searchParams = null, null $sortParams = null, array $additionalParams = array(), JQGridWrapper $JQGridWrapper = null)

JQGrid function

__construct(UserRepository $repository, UserEventContainer $eventContainer)

No description

static mixed
verifyResponse(mixed $response, string $captchaSecret)

Verify captcha

array
findAllUsers()

Finds all users in the database.

getUserById(int $userId)

Find user by id

array
findAllUserNames()

Finds all users in the database.

array
findAllUsersWithSelect()

Find all users as array

bool|string
saveMultiple(array $users, int $flushNumber = 30)

Persist multiple users

array
getUsersIdsAndCustomFiled(string $field)

Find id and provided field for all users

bool
isRequireMailConfirmation()

Check if registration requires mail confirmation

User|mixed
saveUser(User $user, bool $backendSave, $currentUserSettings = null)

Save the user to the database.

editUser(User $user, bool $backendEdit)

Edit the user from database.

simpleUserEdit(User $user)

Update existing user

array
getMailFromDb(int $id)

Find email for user that match provided id

editUserAddress(Address $address, mixed $id)

Edit address for user with id

User|null|object
authenticateUserByToken(string $token)

Find the user by confirmationToken.

User|null|object
loadUser(User $user)

Refresh the user. It is primarily used for loading user on each request.

User|null|object
findUserByUsername(string $userName)

Find the user by confirmationToken.

mixed
findUserByPK(int $id)

No description

array
addToWishList(int $id)

No description

User|null
removeFromWishListAction(int $id)

No description

array
searchForWishlistUserJQGRID(array $searchParams, array $sortParams = array(), array $additionalParams = array())

JQGrid function

array
findAllForWishlistUserJQGRID(int $page, int $offset, array $sortParams, array $additionalParams = array())

JQGrid function

array
getCountForWishlistUserJQGRID(null $searchParams = null, array $sortParams = array(), array $additionalParams = array())

JQGrid function

mixed
getAllAdminUser()

Find all admin users

array
getAllUserByGroupName(string $groupName)

Find all users by group

string
generateLoginRoute()

Generate login route

string
generateAllUsersRoute()

Generate all users route(backend)

array
getAllEmails(mixed $param, mixed $page, mixed $offset, mixed $arrayOfUsers = null, bool $admin = false, bool $locked = true)

Find all users that match provided criteria

array
getAllUsersWithAdditionalInfo(array $param, int $page, int $offset, array|null $arrayOfUsers = null, bool $admin = false)

Find all users that match provided criteria

User|null
getLoggedUser()

No description

mixed|null
getLoggedUserAddress(int $userId)

Find user by id

array
getAllAdminsEmails()

Get all admin users

array
getUsersForDashboard(int $number)

Find provided number of users for dashboard

array
getSocialNetworksLinks(int $userId)

Find social network links for provided user

generateUpdateAPISuccessEvent(User $user)

Generate new event which will start API user update

array
getAllUsersInArray(array $arrayOfUsers)

Find all users that match provided ids

getUserReference(int $id)

Retrieve user reference

mixed
getClientByUserErp(User $user)

Retrieve user from erp by provided code

mixed
updateObjects(User $user)

Update block comment when user change profile picture

array
getUsersWithProductInWishList(int $productId)

Find all users that have provided product in wishlist

dispatchChangePictureSignalEvent(User $user)

Dispatch event when user's profile picture have been changed

dispatchUserChangedSignal(string $theme)

Dispatch event when user have been changed

array
getAllGroups()

Get all groups

editUserAttributeBySetterName(int $userId, string $setter, mixed $value)

Edit user attribute

array
getUsersArray(ArrayCollection $users)

Find all users that match provided ids

static string
generatePassword(int $length = 20)

Generate random password

string|boolean
removeSocialNetworkAccount(String $network)

Updating user

bool|null
updateGdprForLoggedUser()

Update gdpr confirmed for logged user

array
getUsersByStringParam(int $page = 1, int $offset = 10, array $params = null)

Find all users with pagination

array
findUsersByMails(array $mails)

Find users by mails

array
getUserInfoForOrder(int $id)

Find user by id

User|null
getNumberOfOrdersForUser(int $userId, string $orderState = 'pending')

Get number of orders for user

array
getAllEmailsForArrayOfIds(array|null $ids = null)

Get all emails for array of ids

User|null
getCurrentUser()

No description

Event
getUserFinancialCard(int $page, int $offset, string $userCode = null)

Retrieve user financial cards

array
getUserIdErpCodes()

Find id and erp code of all users

bool|string
updateAccountBalance(array $data)

Update account balance

addUserToNewsletter(User $user, bool $ignoreDuplicate = false)

No description

array|null
getUserDataFromErp(User $user)

No description

array
getBaseUserDataInArray()

Find all users as array

bool
checkUserSecondaryCode(string $code)

Check if user for provided code exist

bool
updateAddressErpCode(Address $address)

Update address erp code

array
getAllUsersShippingAddresses()

Find all user's shipping address

bool|string
reCacheUserPricelistItemsArray()

Re-cache pricelist on user

bool|string
reCacheUserGroupDiscountsArray(array $ids = [])

Re-cache product groups on user

mixed
getEm()

No description

Details

in JQGridManagerTrait at line 26
mixed searchForJQGRID(array $searchParams, array $sortParams = array(), array $additionalParams = array(), JQGridWrapper $jqGridWrapper = null)

Parameters

array $searchParams
array $sortParams
array $additionalParams
JQGridWrapper $jqGridWrapper

Return Value

mixed

in JQGridManagerTrait at line 40
mixed findAllForJQGRID(int $page, int $offset, array $sortParams, array $additionalParams = array(), JQGridWrapper $jqGridWrapper = null)

Parameters

int $page
int $offset
array $sortParams
array $additionalParams
JQGridWrapper $jqGridWrapper

Return Value

mixed

at line 442
array getCountForJQGRID(null $searchParams = null, null $sortParams = null, array $additionalParams = array(), JQGridWrapper $JQGridWrapper = null)

JQGrid function

Parameters

null $searchParams
null $sortParams
array $additionalParams
JQGridWrapper $JQGridWrapper

Return Value

array

at line 55
__construct(UserRepository $repository, UserEventContainer $eventContainer)

Parameters

UserRepository $repository
UserEventContainer $eventContainer

at line 70
static mixed verifyResponse(mixed $response, string $captchaSecret)

Verify captcha

Parameters

mixed $response
string $captchaSecret

Return Value

mixed

Exceptions

GuzzleException

at line 94
array findAllUsers()

Finds all users in the database.

Return Value

array The entities.

at line 108
User getUserById(int $userId)

Find user by id

Parameters

int $userId

Return Value

User

Exceptions

NoResultException
NonUniqueResultException

at line 118
array findAllUserNames()

Finds all users in the database.

Return Value

array

at line 128
array findAllUsersWithSelect()

Find all users as array

Return Value

array

at line 140
bool|string saveMultiple(array $users, int $flushNumber = 30)

Persist multiple users

Parameters

array $users
int $flushNumber

Return Value

bool|string

at line 151
array getUsersIdsAndCustomFiled(string $field)

Find id and provided field for all users

Parameters

string $field

Return Value

array

at line 165
bool isRequireMailConfirmation()

Check if registration requires mail confirmation

Return Value

bool

at line 173
User|mixed saveUser(User $user, bool $backendSave, $currentUserSettings = null)

Save the user to the database.

Parameters

User $user
bool $backendSave
$currentUserSettings

Return Value

User|mixed

at line 232
User editUser(User $user, bool $backendEdit)

Edit the user from database.

Parameters

User $user
  • User from database
bool $backendEdit
  • is admin editing user

Return Value

User

at line 331
User simpleUserEdit(User $user)

Update existing user

Parameters

User $user

Return Value

User

at line 342
array getMailFromDb(int $id)

Find email for user that match provided id

Parameters

int $id

Return Value

array

at line 357
editUserAddress(Address $address, mixed $id)

Edit address for user with id

Parameters

Address $address
  • Address object
mixed $id
  • Id for user

Exceptions

ORMException
OptimisticLockException

at line 365
User|null|object authenticateUserByToken(string $token)

Find the user by confirmationToken.

Parameters

string $token

Return Value

User|null|object

at line 375
User|null|object loadUser(User $user)

Refresh the user. It is primarily used for loading user on each request.

Parameters

User $user

Return Value

User|null|object

at line 385
User|null|object findUserByUsername(string $userName)

Find the user by confirmationToken.

Parameters

string $userName

Return Value

User|null|object

at line 393
mixed findUserByPK(int $id)

Parameters

int $id

Return Value

mixed

at line 401
array addToWishList(int $id)

Parameters

int $id

Return Value

array

Exceptions

ORMException
OptimisticLockException

at line 418
User|null removeFromWishListAction(int $id)

Parameters

int $id

Return Value

User|null

at line 455
array searchForWishlistUserJQGRID(array $searchParams, array $sortParams = array(), array $additionalParams = array())

JQGrid function

Parameters

array $searchParams
array $sortParams
array $additionalParams

Return Value

array

at line 469
array findAllForWishlistUserJQGRID(int $page, int $offset, array $sortParams, array $additionalParams = array())

JQGrid function

Parameters

int $page
int $offset
array $sortParams
array $additionalParams

Return Value

array

at line 482
array getCountForWishlistUserJQGRID(null $searchParams = null, array $sortParams = array(), array $additionalParams = array())

JQGrid function

Parameters

null $searchParams
array $sortParams
array $additionalParams

Return Value

array

at line 492
mixed getAllAdminUser()

Find all admin users

Return Value

mixed

at line 503
array getAllUserByGroupName(string $groupName)

Find all users by group

Parameters

string $groupName

Return Value

array

at line 513
string generateLoginRoute()

Generate login route

Return Value

string

at line 523
string generateAllUsersRoute()

Generate all users route(backend)

Return Value

string

at line 539
array getAllEmails(mixed $param, mixed $page, mixed $offset, mixed $arrayOfUsers = null, bool $admin = false, bool $locked = true)

Find all users that match provided criteria

Parameters

mixed $param
mixed $page
mixed $offset
mixed $arrayOfUsers
bool $admin
bool $locked

Return Value

array

at line 554
array getAllUsersWithAdditionalInfo(array $param, int $page, int $offset, array|null $arrayOfUsers = null, bool $admin = false)

Find all users that match provided criteria

Parameters

array $param
int $page
int $offset
array|null $arrayOfUsers
bool $admin

Return Value

array

at line 562
User|null getLoggedUser()

Return Value

User|null

at line 575
mixed|null getLoggedUserAddress(int $userId)

Find user by id

Parameters

int $userId

Return Value

mixed|null

Exceptions

NonUniqueResultException

at line 585
array getAllAdminsEmails()

Get all admin users

Return Value

array

at line 596
array getUsersForDashboard(int $number)

Find provided number of users for dashboard

Parameters

int $number

Return Value

array

Find social network links for provided user

Parameters

int $userId

Return Value

array

Exceptions

Exception

at line 619
generateUpdateAPISuccessEvent(User $user)

Generate new event which will start API user update

Parameters

User $user

at line 630
array getAllUsersInArray(array $arrayOfUsers)

Find all users that match provided ids

Parameters

array $arrayOfUsers

Return Value

array

at line 641
User getUserReference(int $id)

Retrieve user reference

Parameters

int $id

Return Value

User

at line 652
mixed getClientByUserErp(User $user)

Retrieve user from erp by provided code

Parameters

User $user

Return Value

mixed

at line 663
mixed updateObjects(User $user)

Update block comment when user change profile picture

Parameters

User $user

Return Value

mixed

at line 674
array getUsersWithProductInWishList(int $productId)

Find all users that have provided product in wishlist

Parameters

int $productId

Return Value

array

at line 685
UserPictureChangedSignalEvent dispatchChangePictureSignalEvent(User $user)

Dispatch event when user's profile picture have been changed

Parameters

User $user

Return Value

UserPictureChangedSignalEvent

at line 696
SidebarReviewsUserEvent dispatchUserChangedSignal(string $theme)

Dispatch event when user have been changed

Parameters

string $theme

Return Value

SidebarReviewsUserEvent

at line 706
array getAllGroups()

Get all groups

Return Value

array

at line 719
User editUserAttributeBySetterName(int $userId, string $setter, mixed $value)

Edit user attribute

Parameters

int $userId
string $setter
mixed $value

Return Value

User

at line 733
array getUsersArray(ArrayCollection $users)

Find all users that match provided ids

Parameters

ArrayCollection $users

Return Value

array

at line 749
static string generatePassword(int $length = 20)

Generate random password

Parameters

int $length

Return Value

string

at line 766
string|boolean removeSocialNetworkAccount(String $network)

Updating user

Parameters

String $network

Return Value

string|boolean

Exceptions

ORMException
OptimisticLockException

at line 792
bool|null updateGdprForLoggedUser()

Update gdpr confirmed for logged user

Return Value

bool|null

at line 813
array getUsersByStringParam(int $page = 1, int $offset = 10, array $params = null)

Find all users with pagination

Parameters

int $page
int $offset
array $params

Return Value

array

at line 824
array findUsersByMails(array $mails)

Find users by mails

Parameters

array $mails

Return Value

array

at line 835
array getUserInfoForOrder(int $id)

Find user by id

Parameters

int $id

Return Value

array

at line 843
UserSettings getCurrentUserSettings()

Return Value

UserSettings

at line 857
User|null getNumberOfOrdersForUser(int $userId, string $orderState = 'pending')

Get number of orders for user

Parameters

int $userId
string $orderState

Return Value

User|null

Exceptions

NonUniqueResultException

at line 868
array getAllEmailsForArrayOfIds(array|null $ids = null)

Get all emails for array of ids

Parameters

array|null $ids

Return Value

array

at line 876
User|null getCurrentUser()

Return Value

User|null

at line 889
Event getUserFinancialCard(int $page, int $offset, string $userCode = null)

Retrieve user financial cards

Parameters

int $page
int $offset
string $userCode

Return Value

Event

at line 899
array getUserIdErpCodes()

Find id and erp code of all users

Return Value

array

at line 910
bool|string updateAccountBalance(array $data)

Update account balance

Parameters

array $data

Return Value

bool|string

at line 919
addUserToNewsletter(User $user, bool $ignoreDuplicate = false)

Parameters

User $user
bool $ignoreDuplicate

at line 929
array|null getUserDataFromErp(User $user)

Parameters

User $user

Return Value

array|null

at line 939
array getBaseUserDataInArray()

Find all users as array

Return Value

array

at line 950
bool checkUserSecondaryCode(string $code)

Check if user for provided code exist

Parameters

string $code

Return Value

bool

at line 961
bool updateAddressErpCode(Address $address)

Update address erp code

Parameters

Address $address

Return Value

bool

at line 971
array getAllUsersShippingAddresses()

Find all user's shipping address

Return Value

array

at line 981
bool|string reCacheUserPricelistItemsArray()

Re-cache pricelist on user

Return Value

bool|string

at line 993
bool|string reCacheUserGroupDiscountsArray(array $ids = [])

Re-cache product groups on user

Parameters

array $ids

Return Value

bool|string

at line 1001
mixed getEm()

Return Value

mixed