src/UserAttribution.php
public function remove($sourceId, $targetId = null, $roleId = null)
    {
        $request = (new RequestDescriptor())
            ->setUrl($this->buildUrl(self::IDP_ATTRIBUTIONS_API))
            ->setMethod('DELETE')
            ->setRawData(json_encode([
                'source_id' => $sourceId,
                'target_id' => $targetId,
                'role_id' => $roleId,
            ]));

        try {
            $this->send($request);
        } catch (\Exception $e) {
            $previous = $e->getPrevious();

            if ($previous instanceof BadResponseException) {
                $error = json_decode($previous->getResponse()->getBody(), true);

                throw new UserAttributionException($error['error'], $error['code'], $previous);
            }

            throw new UserAttributionException($e->getMessage(), $e->getCode(), $e->getPrevious());
        }
    }
public function remove($sourceId, $targetId = null, $roleId = null)
    {
        $request = (new RequestDescriptor())
            ->setUrl($this->buildUrl(self::IDP_ATTRIBUTIONS_API))
            ->setMethod('DELETE')
            ->setRawData(json_encode([
                'source_id' => $sourceId,
                'target_id' => $targetId,
                'role_id' => $roleId,
            ]));

        try {
            $this->send($request);
        } catch (\Exception $e) {
            $previous = $e->getPrevious();

            if ($previous instanceof BadResponseException) {
                $error = json_decode($previous->getResponse()->getBody(), true);

                throw new UserAttributionException($error['error'], $error['code'], $previous);
            }

            throw new UserAttributionException($e->getMessage(), $e->getCode(), $e->getPrevious());
        }
    }
public function remove ( $ sourceId , $ targetId = null , $ roleId = null ) { $ request = ( new RequestDescriptor ( ) ) -> setUrl ( $ this -> buildUrl ( self :: IDP_ATTRIBUTIONS_API ) ) -> setMethod ( 'DELETE' ) -> setRawData ( json_encode ( [ 'source_id' => $ sourceId , 'target_id' => $ targetId , 'role_id' => $ roleId , ] ) ) ; try { $ this -> send ( $ request ) ; } catch ( \ Exception $ e ) { $ previous = $ e -> getPrevious ( ) ; if ( $ previous instanceof BadResponseException ) { $ error = json_decode ( $ previous -> getResponse ( ) -> getBody ( ) , true ) ; throw new UserAttributionException ( $ error [ 'error' ] , $ error [ 'code' ] , $ previous ) ; } throw new UserAttributionException ( $ e -> getMessage ( ) , $ e -> getCode ( ) , $ e -> getPrevious ( ) ) ; } }
Remove attributions for a user. An application and a role can be defined to target more attributions more
precisely.

@param int $sourceId
@param int $targetId
@param int $roleId
If omitted, all attributions link to this source / target will be deleted.
Remove attributions for a user . An application and a role can be defined to target more attributions more precisely .