src/CMDBObjects.php
public function create(array $objects) {
        $requests = [];

        foreach ($objects as $object) {
            $requests[] = [
                'method' => 'cmdb.object.create',
                'params' => $object
            ];
        }

        $result = $this->api->batchRequest($requests);

        $objectIDs = [];

        foreach ($result as $object) {
            $objectIDs[] = $object['id'];
        }

        return $objectIDs;
    }
public function create(array $objects) {
        $requests = [];

        foreach ($objects as $object) {
            $requests[] = [
                'method' => 'cmdb.object.create',
                'params' => $object
            ];
        }

        $result = $this->api->batchRequest($requests);

        $objectIDs = [];

        foreach ($result as $object) {
            $objectIDs[] = $object['id'];
        }

        return $objectIDs;
    }
public function create ( array $ objects ) { $ requests = [ ] ; foreach ( $ objects as $ object ) { $ requests [ ] = [ 'method' => 'cmdb.object.create' , 'params' => $ object ] ; } $ result = $ this -> api -> batchRequest ( $ requests ) ; $ objectIDs = [ ] ; foreach ( $ result as $ object ) { $ objectIDs [ ] = $ object [ 'id' ] ; } return $ objectIDs ; }
Create one or more objects

@param array $objects Mandatory attributes ('type', 'title') and optional attributes
('category', 'purpose', 'cmdb_status', 'description')

@return array List of object identifiers

@throws Exception on error
Create one or more objects