PHP SOAP CustomerGroup GroupMemberAdd

English! place to talk about development, programming and coding
Post Reply
sk3l3t0n
Znuny newbie
Posts: 1
Joined: 11 Feb 2012, 00:23
Znuny Version: 3.0

PHP SOAP CustomerGroup GroupMemberAdd

Post by sk3l3t0n »

Hallo,
ich möchte mit PHP die Funktion GroupMemberAdd aufrufen. Die API dazu sieht ja so aus:

Code: Select all

 my $ID = $CustomerGroupObject->GroupMemberAdd(
        GID => 12,
        UID => 6,
        Permission => {
            ro        => 1,
            move_into => 1,
            create    => 1,
            owner     => 1,
            priority  => 0,
            rw        => 0,
        },
        UserID => 123,
    );
mit PHP würde das so aussehen:

Code: Select all

	public function groupMemberAdd()
	{
		$result = false;
		
		$result = $this->soapClient->__soapCall(
			'Dispatch',
			array(
				$this->user,
				$this->pass,
				'CustomerGroupObject',
				'GroupMemberAdd',
				'GID', '',
				'UID', '',
				'Permission', '',	//<- Problem denn hier wird noch eine Array Stufe gebraucht
				'UserID', ''
			)
		);
		
		return $result;
	}
Leider wird in Perl immer ein
Schlüssel => Wert
angegeben, was in PHP durch Komma getrennt ist
Schlüssel, Wert
Jetzt habe ich bei der Funktion ein Array im Wert also noch ein Schlüssel-Wert Paar wie gehe ich damit um?

Gruß

Edit: ok hat sich erledigt, man übergibt einfach ein Array... omg :D
Alexander Halle
Znuny expert
Posts: 296
Joined: 04 Jul 2010, 17:49
Znuny Version: 3.1.x
Real Name: Alexander Halle
Company: radprax MVZ GmbH
Location: Wuppertal
Contact:

Re: PHP SOAP CustomerGroup GroupMemberAdd

Post by Alexander Halle »

Many thanks for sharing your knowledge.

Please notice for future postings that the language in the developer forum is English only to avoid a fragmentation the developer community.
Alexander Halle System: OTRS 3.1.x, Ubuntu 10.04.x LTS, MySQL 5.1.x, Apache 2.2.x
OTRS Community Links: User Meetings, Projects
Post Reply