code: public function isMemberOf($group)
      {
          foreach ($this->attributes['member_of'] as $groups) {
              if (preg_match('/^CN=' . $group . '/', $groups)) {
                  return true;
              }
          }
  
          return false;
      }
docs: Check if the LdapUser is a member of requested group
  
  @param string $group
  
  @return bool