There might be a method, but i don't know of one.
The group blob is a serialized array of ids from the tl_member_group table (which holds the group name etc)
So you can unserialize ( or deserialize, a Contao function)
and process array.
eg - here i'm finding the "Joblisting Accounts" group id:
Code:
//get the id number of the group Joblisting Accounts
$objGroup = $this->Database->prepare("SELECT id, name FROM tl_member_group WHERE name='Joblisting Accounts'")
->limit(1)
->execute();
$groupId = $objGroup->id;
//unserialize the groups this member belongs to
$groupIdArray = deserialize($dc->activeRecord->groups, true);
//and if Joblisting Accounts is ticked
if(in_array($groupId,$groupIdArray))
....
{
If you are adding to the tl_member groups blob, add the group id to the array and serialize before updating
Bookmarks