src/Image.php
public function batchAdd($objectID, array $images) {
        $objectIDs = [$objectID];
        $categoryConst = 'C__CATG__IMAGES';
        $attributes = [];

        foreach ($images as $filePath => $caption) {
            $imageAsString = $this->encode($filePath);

            $attributes[] = [
                'name' => $caption,
                'content' => $imageAsString
            ];
        }

        $cmdbCategory = new CMDBCategory($this->api);

        $cmdbCategory->batchCreate($objectIDs, $categoryConst, $attributes);

        return $this;
    }
public function batchAdd($objectID, array $images) {
        $objectIDs = [$objectID];
        $categoryConst = 'C__CATG__IMAGES';
        $attributes = [];

        foreach ($images as $filePath => $caption) {
            $imageAsString = $this->encode($filePath);

            $attributes[] = [
                'name' => $caption,
                'content' => $imageAsString
            ];
        }

        $cmdbCategory = new CMDBCategory($this->api);

        $cmdbCategory->batchCreate($objectIDs, $categoryConst, $attributes);

        return $this;
    }
public function batchAdd ( $ objectID , array $ images ) { $ objectIDs = [ $ objectID ] ; $ categoryConst = 'C__CATG__IMAGES' ; $ attributes = [ ] ; foreach ( $ images as $ filePath => $ caption ) { $ imageAsString = $ this -> encode ( $ filePath ) ; $ attributes [ ] = [ 'name' => $ caption , 'content' => $ imageAsString ] ; } $ cmdbCategory = new CMDBCategory ( $ this -> api ) ; $ cmdbCategory -> batchCreate ( $ objectIDs , $ categoryConst , $ attributes ) ; return $ this ; }
Add new files to the image gallery.

@param int $objectID Object identifier
@param array $images Associative array (key: path to image file; value: caption)

@return self Returns itself

@throws Exception on error
Add new files to the image gallery .