public function _addContact($jid, $subscription, $name = '', $groups = [])
    {
        $contact = ['jid' => $jid, 'subscription' => $subscription, 'name' => $name, 'groups' => $groups];
        if ($this->isContact($jid)) {
            $this->roster_array[$jid]['contact'] = $contact;
        } else {
            $this->roster_array[$jid] = ['contact' => $contact];
        }
    }
public function _addContact($jid, $subscription, $name = '', $groups = [])
    {
        $contact = ['jid' => $jid, 'subscription' => $subscription, 'name' => $name, 'groups' => $groups];
        if ($this->isContact($jid)) {
            $this->roster_array[$jid]['contact'] = $contact;
        } else {
            $this->roster_array[$jid] = ['contact' => $contact];
        }
    }
public function _addContact ( $ jid , $ subscription , $ name = '' , $ groups = [ ] ) { $ contact = [ 'jid' => $ jid , 'subscription' => $ subscription , 'name' => $ name , 'groups' => $ groups ] ; if ( $ this -> isContact ( $ jid ) ) { $ this -> roster_array [ $ jid ] [ 'contact' ] = $ contact ; } else { $ this -> roster_array [ $ jid ] = [ 'contact' => $ contact ] ; } }
Add given contact to roster
@param string $jid
@param string $subscription
@param string $name
@param array $groups
Add given contact to roster