examples/whatsapp.php
public function processGroupArray($phone, $groupArray)
    {
        $formattedGroups = [];

        if (!empty($groupArray)) {
            foreach ($groupArray as $group) {
                $formattedGroups[] = ['name' => 'GROUP: '.$group['subject'], 'id' => $group['id']];
            }

            $this->waGroupList = $formattedGroups;

            return true;
        }

        return false;
    }
public function processGroupArray($phone, $groupArray)
    {
        $formattedGroups = [];

        if (!empty($groupArray)) {
            foreach ($groupArray as $group) {
                $formattedGroups[] = ['name' => 'GROUP: '.$group['subject'], 'id' => $group['id']];
            }

            $this->waGroupList = $formattedGroups;

            return true;
        }

        return false;
    }
public function processGroupArray ( $ phone , $ groupArray ) { $ formattedGroups = [ ] ; if ( ! empty ( $ groupArray ) ) { foreach ( $ groupArray as $ group ) { $ formattedGroups [ ] = [ 'name' => 'GROUP: ' . $ group [ 'subject' ] , 'id' => $ group [ 'id' ] ] ; } $ this -> waGroupList = $ formattedGroups ; return true ; } return false ; }
Process the event onGetGroupList and sets a formatted array of groups the user belongs to.

@param string $phone      The phone number (jid ) of the user
@param array  $groupArray Array with details of all groups user eitehr belongs to or owns.

@return array|bool
Process the event onGetGroupList and sets a formatted array of groups the user belongs to .