src/CMDBObject.php
public function createWithCategories($type, $title, array $categories = [], array $attributes = []) {
        $attributes['type'] = $type;
        $attributes['title'] = $title;

        if (count($categories) > 0) {
            $attributes['categories'] = $categories;
        }

        return $this->api->request(
            'cmdb.object.create',
            $attributes
        );
    }
public function createWithCategories($type, $title, array $categories = [], array $attributes = []) {
        $attributes['type'] = $type;
        $attributes['title'] = $title;

        if (count($categories) > 0) {
            $attributes['categories'] = $categories;
        }

        return $this->api->request(
            'cmdb.object.create',
            $attributes
        );
    }
public function createWithCategories ( $ type , $ title , array $ categories = [ ] , array $ attributes = [ ] ) { $ attributes [ 'type' ] = $ type ; $ attributes [ 'title' ] = $ title ; if ( count ( $ categories ) > 0 ) { $ attributes [ 'categories' ] = $ categories ; } return $ this -> api -> request ( 'cmdb.object.create' , $ attributes ) ; }
Create new object with category entries

@param int|string $type Object type identifier or its constant
@param string $title Object title
@param array $categories Also create category entries;
set category constant (string) as key and
one (array of attributes) entry or even several entries (array of arrays) as value
@param array $attributes (Optional) additional common attributes:
string|int "category",
string|int "cmdb_status",
0|1 "defaultTemplate",
string "description",
string|int "purpose",
int "status",
string "sysid"

@return array Result with object identifier ('id') and
key-value pairs of category constants and array of category entry identifiers as integers

@throws Exception on error
Create new object with category entries