src/Image.php
public function add($objectID, $filePath, $caption = '') {
        $imageAsString = $this->encode($filePath);

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

        $cmdbCategory->create(
            $objectID,
            'C__CATG__IMAGES',
            [
                'name' => $caption,
                'content' => $imageAsString
            ]
        );

        return $this;
    }
public function add($objectID, $filePath, $caption = '') {
        $imageAsString = $this->encode($filePath);

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

        $cmdbCategory->create(
            $objectID,
            'C__CATG__IMAGES',
            [
                'name' => $caption,
                'content' => $imageAsString
            ]
        );

        return $this;
    }
public function add ( $ objectID , $ filePath , $ caption = '' ) { $ imageAsString = $ this -> encode ( $ filePath ) ; $ cmdbCategory = new CMDBCategory ( $ this -> api ) ; $ cmdbCategory -> create ( $ objectID , 'C__CATG__IMAGES' , [ 'name' => $ caption , 'content' => $ imageAsString ] ) ; return $ this ; }
Add a new file to the image gallery.

@param int $objectID Object identifier
@param string $filePath Path to image file
@param string $caption (Optional) caption

@return self Returns itself

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