src/Model/ApiResourceBase.php
protected function runOperation($op, $method = 'post', array $body = [])
    {
        if (!$this->operationAvailable($op, true)) {
            throw new OperationUnavailableException("Operation not available: $op");
        }
        $options = [];
        if (!empty($body)) {
            $options['json'] = $body;
        }
        $request= new Request($method, $this->getLink("#$op"));
        $data = $this->send($request, $this->client, $options);

        return new Result($data, $this->baseUrl, $this->client, get_called_class());
    }
protected function runOperation($op, $method = 'post', array $body = [])
    {
        if (!$this->operationAvailable($op, true)) {
            throw new OperationUnavailableException("Operation not available: $op");
        }
        $options = [];
        if (!empty($body)) {
            $options['json'] = $body;
        }
        $request= new Request($method, $this->getLink("#$op"));
        $data = $this->send($request, $this->client, $options);

        return new Result($data, $this->baseUrl, $this->client, get_called_class());
    }
protected function runOperation ( $ op , $ method = 'post' , array $ body = [ ] ) { if ( ! $ this -> operationAvailable ( $ op , true ) ) { throw new OperationUnavailableException ( "Operation not available: $op" ) ; } $ options = [ ] ; if ( ! empty ( $ body ) ) { $ options [ 'json' ] = $ body ; } $ request = new Request ( $ method , $ this -> getLink ( "#$op" ) ) ; $ data = $ this -> send ( $ request , $ this -> client , $ options ) ; return new Result ( $ data , $ this -> baseUrl , $ this -> client , get_called_class ( ) ) ; }
Execute an operation on the resource.

@param string $op
@param string $method
@param array  $body

@return Result
Execute an operation on the resource .