src/CMDBCategory.php
public function update($objectID, $categoryConst, array $attributes, $entryID = null) {
        if (isset($entryID)) {
            $attributes['category_id'] = $entryID;
        }

        $result = $this->api->request(
            'cmdb.category.update',
            [
                'objID' => $objectID,
                'category' => $categoryConst,
                'data' => $attributes
            ]
        );

        if (!array_key_exists('success', $result) ||
            $result['success'] !== true) {
            if (array_key_exists('message', $result)) {
                throw new RuntimeException(sprintf('Bad result: %s', $result['message']));
            } else {
                throw new RuntimeException('Bad result');
            }
        }

        return $this;
    }
public function update($objectID, $categoryConst, array $attributes, $entryID = null) {
        if (isset($entryID)) {
            $attributes['category_id'] = $entryID;
        }

        $result = $this->api->request(
            'cmdb.category.update',
            [
                'objID' => $objectID,
                'category' => $categoryConst,
                'data' => $attributes
            ]
        );

        if (!array_key_exists('success', $result) ||
            $result['success'] !== true) {
            if (array_key_exists('message', $result)) {
                throw new RuntimeException(sprintf('Bad result: %s', $result['message']));
            } else {
                throw new RuntimeException('Bad result');
            }
        }

        return $this;
    }
public function update ( $ objectID , $ categoryConst , array $ attributes , $ entryID = null ) { if ( isset ( $ entryID ) ) { $ attributes [ 'category_id' ] = $ entryID ; } $ result = $ this -> api -> request ( 'cmdb.category.update' , [ 'objID' => $ objectID , 'category' => $ categoryConst , 'data' => $ attributes ] ) ; if ( ! array_key_exists ( 'success' , $ result ) || $ result [ 'success' ] !== true ) { if ( array_key_exists ( 'message' , $ result ) ) { throw new RuntimeException ( sprintf ( 'Bad result: %s' , $ result [ 'message' ] ) ) ; } else { throw new RuntimeException ( 'Bad result' ) ; } } return $ this ; }
Update category entry for a specific object

@param int $objectID Object identifier
@param string $categoryConst Category constant
@param array $attributes Attributes as key-value pairs
@param int $entryID Entry identifier (only needed for multi-value categories)

@return self Returns itself

@throws Exception on error
Update category entry for a specific object