src/Recipient/ProcessedContact.php
public function getGroups(Communicator $communicator = null): ClassValidationArray
    {
        if ($communicator !== null) {
            $groupsJSON = $communicator->get('api/contacts/'.$this->contactID. '/groups');
            $groupStd = json_decode($groupsJSON);
            $groups = RecipientFactory::createProcessedGroupsFromStdClassArray($groupStd);
            $this->groups = $groups;
            $this->fetchedGroups = true;
        }
        return $this->groups;
    }
public function getGroups(Communicator $communicator = null): ClassValidationArray
    {
        if ($communicator !== null) {
            $groupsJSON = $communicator->get('api/contacts/'.$this->contactID. '/groups');
            $groupStd = json_decode($groupsJSON);
            $groups = RecipientFactory::createProcessedGroupsFromStdClassArray($groupStd);
            $this->groups = $groups;
            $this->fetchedGroups = true;
        }
        return $this->groups;
    }
public function getGroups ( Communicator $ communicator = null ) : ClassValidationArray { if ( $ communicator !== null ) { $ groupsJSON = $ communicator -> get ( 'api/contacts/' . $ this -> contactID . '/groups' ) ; $ groupStd = json_decode ( $ groupsJSON ) ; $ groups = RecipientFactory :: createProcessedGroupsFromStdClassArray ( $ groupStd ) ; $ this -> groups = $ groups ; $ this -> fetchedGroups = true ; } return $ this -> groups ; }
Returns an array of all the Groups the group is referenced in.
If a communicator is not provided it will not fetch memberships from the API
but return those that has been fetched, if any.
@param Communicator $communicator Used to fetch Groups from the API.
@return ClassValidationArray An array of Group objects.
Returns an array of all the Groups the group is referenced in . If a communicator is not provided it will not fetch memberships from the API but return those that has been fetched if any .