UserBrandsManager
class UserBrandsManager implements BasicEntityManagerInterface
Class UserBrandsManager is injected as user_brands.manager service. UserBrandsManager handles the logic for entity.
Properties
| protected UserBrandsRepository | $repository | ||
| protected BrandManager | $brandManager | ||
| protected UserManager | $userManager |
Methods
UserBrandsManager constructor.
Bet all brands from database. Returns only id and name of brand
Gets all disabled brand for specified user If joinWithBrand param is true it will join UserDisabledBrand with Brand If joinWithBrand if false or missing function will return only ids of brands
Get current user
Prepare data for csv download. Create matrix of all user and all brands Where brand is disabled for user value in matrix is marked with 'X'
Disable multiple brands for specified user
Details
at line 40
__construct(UserBrandsRepository $repository, BrandManager $brandManager, UserManager $userManager)
UserBrandsManager constructor.
at line 52
array
getAllBrands()
Bet all brands from database. Returns only id and name of brand
at line 67
array
getDisabledBrandIdsForUser(mixed $userId, bool $joinWithBrand = false)
Gets all disabled brand for specified user If joinWithBrand param is true it will join UserDisabledBrand with Brand If joinWithBrand if false or missing function will return only ids of brands
at line 77
User|null
getCurrentUser()
Get current user
at line 88
array
getAllDataForDownload()
Prepare data for csv download. Create matrix of all user and all brands Where brand is disabled for user value in matrix is marked with 'X'
at line 123
mixed
disableBrands(int $userId, array $disabledBrands)
Disable multiple brands for specified user