class GroupRepository extends EntityRepository

Class GroupRepository is injected as alligator.group_repository service. GroupRepository is used for crud operation for entity.

Use this class to work with database.

Constants

USERS_GROUP

COMPANY_GROUP

ROLE_ALIAS

Alias for role entity

ALIAS

Alias for entity

GROUP_USER_TABLE_NAME

GROUP_USER_TABLE_GROUP_COLUMN

ADMIN_ROLE

Methods

array
findAllGroups()

Get all groups

array
findAllGroupsFromArray(array $groups)

Get all groups

findGroupByUser(User $user)

Utility override to be used by the UserManager {@inheritDoc}

mixed
findGroupForUser(User $user)

Find group that correspond to provided user type

saveGroup(Group $group)

Save new group

edit(Group $group)

Update existing group

bool
removeGroup(Group $group)

Remove group

Group|Proxy|null|object
getReference(int $id)

No description

boolean
changeUsersGroup(int $oldGroupId, int $newGroupId)

No description

Details

at line 48
array findAllGroups()

Get all groups

Return Value

array

at line 62
array findAllGroupsFromArray(array $groups)

Get all groups

Parameters

array $groups

Return Value

array

at line 79
findGroupByUser(User $user)

Utility override to be used by the UserManager {@inheritDoc}

Parameters

User $user

at line 98
mixed findGroupForUser(User $user)

Find group that correspond to provided user type

Parameters

User $user

Return Value

mixed

Exceptions

NoResultException
NonUniqueResultException

at line 114
Group saveGroup(Group $group)

Save new group

Parameters

Group $group

Return Value

Group

at line 132
Group edit(Group $group)

Update existing group

Parameters

Group $group

Return Value

Group

at line 150
bool removeGroup(Group $group)

Remove group

Parameters

Group $group

Return Value

bool

at line 167
Group|Proxy|null|object getReference(int $id)

Parameters

int $id

Return Value

Group|Proxy|null|object

at line 178
boolean changeUsersGroup(int $oldGroupId, int $newGroupId)

Parameters

int $oldGroupId
int $newGroupId

Return Value

boolean