UserRepository
class UserRepository extends EntityRepository implements UserProviderInterface, UserLoaderInterface
Class UserRepository is injected as alligator.user_repository service. UserRepository is used for crud operation for managed entity.
Use this class to work with database.
Traits
Constants
| ALIAS |
Alias for entity |
| ADDRESS_ALIAS |
Alias for address entity |
| ORDER_ALIAS |
Alias for order entity |
| GROUP_ALIAS |
Alias for group entity |
| PRODUCT_ALIAS |
Alias for product entity |
| WISHLIST_ALIAS |
Alias for wishlist entity |
| COMPANY_ALIAS |
Alias for company entity |
| JOIN_WITH_ADDRESS |
|
| JOIN_WITH_COMPANY |
|
| JOIN_WITH_ORDERS |
|
| JOIN_WITH_GROUP |
|
| ROLE_ADMIN |
|
Methods
Should contain group by which jqgrid uses.
JQGrid function
JQGrid function
Utility override to be used by the UserManager
Find user by id
{@inheritDoc}
{@inheritDoc}
{@inheritDoc}
Find user by token
Finds all users in the database.
Find id and provided field for all users
Find all users as array
No description
Persist multiple users
Find email for user that match provided id
No description
This is custom count query because we need to count number of orders and self::ALIAS.id(more then 1 aggregate function) This is only used here, every other query should just count self::ALIAS.id
JQGrid function
JQGrid function
Find all users by group
Find all users that match provided criteria
Find all users that match provided criteria
Get all admin users
Find provided number of users for dashboard
Find social network links for provided user
Find all users that match provided ids
Find user by id
Find all users that have provided product in wishlist
No description
Find all user's shipping address
No description
Find all users that match provided ids
Find all users with pagination
Find users by mails
Find user by id
Get number of orders for user
Get all emails for array of ids
Find id and erp code of all users
Find id, erp code, and id of all user address
Update account balance
Find all users as array
Check if user for provided code exist
Re-caching user specific pricelist
Re-caching user group discounts
Details
in JQGridTrait at line 27
jQGridJoinFields(QueryBuilder $qb, JQGridWrapper $jqGridWrapper)
All joins used in select.
Override in the repository class if needed. Should do nothing otherwise
in JQGridTrait at line 42
jQGridGroupByFields(QueryBuilder $qb, JQGridWrapper $jqGridWrapper)
Should contain group by which jqgrid uses.
Override in the repository class if needed. Should do nothing otherwise
in JQGridTrait at line 61
array
findAllForJQGRID(int $page, int $offset, array $sortParams, array $additionalParams, JQGridWrapper $jqGridWrapper)
JQGrid function
in JQGridTrait at line 94
array
searchForJQGRID(array $searchParams, array $sortParams, bool $isCountSearch = false, array $additionalParams = array(), JQGridWrapper $jqGridWrapper = null)
JQGrid function
at line 88
findOneBy(array $criteria, array $orderBy = null)
Utility override to be used by the UserManager
{@inheritDoc}
at line 134
User
getUserById(int $userId)
Find user by id
at line 150
loadUserByUsername($username)
{@inheritDoc}
at line 174
refreshUser(UserInterface $user)
{@inheritDoc}
at line 198
supportsClass($class)
{@inheritDoc}
at line 209
User|null|object
getUserByToken(string $token)
Find user by token
at line 219
array
getAllUsers()
Finds all users in the database.
at line 230
array
getUsersIdsAndCustomFiled(string $filed)
Find id and provided field for all users
at line 243
array
findAllUsersWithSelect()
Find all users as array
at line 277
EntityManagerInterface
getEm()
at line 289
bool|string
saveMultiple(array $users, int $flushNumber = 30)
Persist multiple users
at line 318
array
getMailFromDb(int $id)
Find email for user that match provided id
at line 399
User
getUserByPK(int $id)
at line 415
User|bool
addToWishList(User $user, Product $product)
Add new product to user's wishlist
at line 440
User|bool
removeFromWishList(User $user, Product $product)
Remove product from user's wishlist
at line 466
mixed
getCountForJQGRIDCustom(array|null $searchParams, array|null $sortParams, true $isCountSearch, array|null $additionalParams, JQGridWrapper|null $jqGridWrapper)
This is custom count query because we need to count number of orders and self::ALIAS.id(more then 1 aggregate function) This is only used here, every other query should just count self::ALIAS.id
at line 536
array
findAllForWishlistUserJQGRID(mixed $page, mixed $offset, array $sortParams = array(), array $additionalParams = array())
JQGrid function
at line 571
array
searchForWishlistUserJQGRID(mixed $searchParams, bool $isCountSearch = false, array $sortParams = array(), array $additionalParams = array())
JQGrid function
at line 633
array
getUsersByGroup(string $groupName = 'ADMIN')
Find all users by group
at line 655
array
getAllEmails(mixed $param, mixed $page, mixed $offset, mixed $arrayOfUsers = null, bool $admin = false, bool $locked = true)
Find all users that match provided criteria
at line 707
array
getAllUsersWithAdditionalInfo(mixed $param, mixed $page, mixed $offset, mixed $arrayOfUsers = null, bool $admin = false)
Find all users that match provided criteria
at line 760
array
getAllAdminsEmails()
Get all admin users
at line 778
array
getUsersForDashboard(int $number)
Find provided number of users for dashboard
at line 816
array
getSocialNetworksLinks(int $userId)
Find social network links for provided user
at line 832
array
getAllUsersInArray(array $arrayOfUsers)
Find all users that match provided ids
at line 852
array
getLoggedUserAddress(int $userId)
Find user by id
at line 871
array
getUsersWithProductInWishList(int $productId)
Find all users that have provided product in wishlist
at line 887
User|Proxy|object|null
getUserReference(int $id)
at line 897
array
getAllUsersShippingAddresses()
Find all user's shipping address
at line 914
User|Proxy|null|object
getReference(string $className, int $id)
at line 925
array
getUsersArray(array $userIds)
Find all users that match provided ids
at line 942
array
findUserForEdit(User $user)
Get user from db for user edit
at line 960
array
getUsersByStringParam(int $page = 1, int $offset = 10, array $param = null)
Find all users with pagination
at line 984
array
findUsersByMails(array $mails)
Find users by mails
at line 1007
array
getUserInfoForOrder(int $id)
Find user by id
at line 1024
User|null
getNumberOfOrdersForUser(int $userId, string $orderState)
Get number of orders for user
at line 1043
array
getAllEmailsForArrayOfIds(array $ids = null)
Get all emails for array of ids
at line 1058
array
getUserIdErpCodes()
Find id and erp code of all users
at line 1071
array
getUserIdErpCodeAddresses()
Find id, erp code, and id of all user address
at line 1089
bool|string
updateAccountBalance(array $data)
Update account balance
at line 1127
array
getBaseUserDataInArray()
Find all users as array
at line 1142
bool
checkUserSecondaryCode(string $code)
Check if user for provided code exist
at line 1158
bool|string
reCacheUserPricelistItemsArray()
Re-caching user specific pricelist
at line 1190
bool|string
reCacheUserGroupDiscountsArray(array $ids = [])
Re-caching user group discounts