src/CMDBDialog.php
public function create($category, $attribute, $value, $parent = null) {
        $params = [
            'category' => $category,
            'property' => $attribute,
            'value' => $value
        ];

        if (isset($parent)) {
            $params['parent'] = $parent;
        }

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

        if (!array_key_exists('entry_id', $result) ||
            !is_numeric($result['entry_id'])) {
            throw new RuntimeException('Bad result');
        }

        return (int) $result['entry_id'];
    }
public function create($category, $attribute, $value, $parent = null) {
        $params = [
            'category' => $category,
            'property' => $attribute,
            'value' => $value
        ];

        if (isset($parent)) {
            $params['parent'] = $parent;
        }

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

        if (!array_key_exists('entry_id', $result) ||
            !is_numeric($result['entry_id'])) {
            throw new RuntimeException('Bad result');
        }

        return (int) $result['entry_id'];
    }
public function create ( $ category , $ attribute , $ value , $ parent = null ) { $ params = [ 'category' => $ category , 'property' => $ attribute , 'value' => $ value ] ; if ( isset ( $ parent ) ) { $ params [ 'parent' ] = $ parent ; } $ result = $ this -> api -> request ( 'cmdb.dialog.create' , $ params ) ; if ( ! array_key_exists ( 'entry_id' , $ result ) || ! is_numeric ( $ result [ 'entry_id' ] ) ) { throw new RuntimeException ( 'Bad result' ) ; } return ( int ) $ result [ 'entry_id' ] ; }
Create a new entry for a drop-down menu

@param string $category Category constant
@param string $attribute Attribute
@param mixed $value Value
@param string|integer $parent Reference parent entry by its title (string) or by its identifier (integer)

@return int Entry identifier

@throws Exception on error
Create a new entry for a drop - down menu