src/CMDBObject.php
public function update($objectID, array $attributes = []) {
        $params = [
            'id' => $objectID
        ];

        $supportedAttributes = [
            'title'
        ];

        foreach ($supportedAttributes as $supportedAttribute) {
            if (array_key_exists($supportedAttribute, $attributes)) {
                $params[$supportedAttribute] = $attributes[$supportedAttribute];
            }
        }

        $result = $this->api->request(
            'cmdb.object.update',
            $params
        );

        if (!is_array($result) ||
            !array_key_exists('success', $result) ||
            $result['success'] === false) {
            throw new RuntimeException(sprintf(
                'Unable to archive object %s',
                $objectID
            ));
        }

        return $this;
    }
public function update($objectID, array $attributes = []) {
        $params = [
            'id' => $objectID
        ];

        $supportedAttributes = [
            'title'
        ];

        foreach ($supportedAttributes as $supportedAttribute) {
            if (array_key_exists($supportedAttribute, $attributes)) {
                $params[$supportedAttribute] = $attributes[$supportedAttribute];
            }
        }

        $result = $this->api->request(
            'cmdb.object.update',
            $params
        );

        if (!is_array($result) ||
            !array_key_exists('success', $result) ||
            $result['success'] === false) {
            throw new RuntimeException(sprintf(
                'Unable to archive object %s',
                $objectID
            ));
        }

        return $this;
    }
public function update ( $ objectID , array $ attributes = [ ] ) { $ params = [ 'id' => $ objectID ] ; $ supportedAttributes = [ 'title' ] ; foreach ( $ supportedAttributes as $ supportedAttribute ) { if ( array_key_exists ( $ supportedAttribute , $ attributes ) ) { $ params [ $ supportedAttribute ] = $ attributes [ $ supportedAttribute ] ; } } $ result = $ this -> api -> request ( 'cmdb.object.update' , $ params ) ; if ( ! is_array ( $ result ) || ! array_key_exists ( 'success' , $ result ) || $ result [ 'success' ] === false ) { throw new RuntimeException ( sprintf ( 'Unable to archive object %s' , $ objectID ) ) ; } return $ this ; }
Update existing object

@param int $objectID Object identifier
@param array $attributes (Optional) common attributes (only 'title' is supported at the moment)

@return self Returns itself

@throws Exception on error
Update existing object