src/Jaspersoft/Service/ServerService.php
public function addOrUpdateAttribute(Attribute $attribute)
    {
        $url = self::makeAttributeUrl(null, $attribute->name);
        $body = json_encode($attribute);
        $response = $this->service->prepAndSend($url, array(200, 201), 'PUT', $body, true);

        if (!empty($response)) {
            return Attribute::createFromJSON(json_decode($response));
        } else {
            return true;
        }
    }
public function addOrUpdateAttribute(Attribute $attribute)
    {
        $url = self::makeAttributeUrl(null, $attribute->name);
        $body = json_encode($attribute);
        $response = $this->service->prepAndSend($url, array(200, 201), 'PUT', $body, true);

        if (!empty($response)) {
            return Attribute::createFromJSON(json_decode($response));
        } else {
            return true;
        }
    }
public function addOrUpdateAttribute ( Attribute $ attribute ) { $ url = self :: makeAttributeUrl ( null , $ attribute -> name ) ; $ body = json_encode ( $ attribute ) ; $ response = $ this -> service -> prepAndSend ( $ url , array ( 200 , 201 ) , 'PUT' , $ body , true ) ; if ( ! empty ( $ response ) ) { return Attribute :: createFromJSON ( json_decode ( $ response ) ) ; } else { return true ; } }
Create a new attribute, or update an existing attribute. If created, "true" is returned. If updated,
the server-side representation of the attribute is returned.

@param \Jaspersoft\Dto\Attribute\Attribute $attribute
@return \Jaspersoft\Dto\Attribute\Attribute|bool
Create a new attribute or update an existing attribute . If created true is returned . If updated the server - side representation of the attribute is returned .