\Visionline\Crm\WebApiFilePassthruOperation

Internal class that defines the file-operation "passthru"

Summary

Methods
Properties
Constants
__construct()
exec()
execMultiple()
No public properties found
No constants found
process()
processMetaData()
getResult()
shouldDownload()
$webapi
N/A
download()
$getFileUrl
$connection
$bufferSize
$sendHeaders
$attachment
N/A

Properties

$getFileUrl

$getFileUrl : string

The URL from which to get files

Type

string

$bufferSize

$bufferSize : integer

The buffer size

Type

integer

$sendHeaders

$sendHeaders : boolean

Indicates whether headers should be sent

Type

boolean

$attachment

$attachment : boolean

Indicates whether the Content-disposition header should be set to 'attachment'.

Type

boolean

Methods

__construct()

__construct(\Visionline\Crm\WebApi\WebApi  $webapi, string  $getFileUrl, \Visionline\Crm\WebApi\Connection  $connection, integer  $bufferSize, boolean  $sendHeaders, boolean  $attachment) 

Creates a FilePassthruOperation

Parameters

\Visionline\Crm\WebApi\WebApi $webapi

The WebApi

string $getFileUrl

The URL of the GetFile-Handler

\Visionline\Crm\WebApi\Connection $connection

The connection settings to the CRM-VISIONLINE system

integer $bufferSize

The buffer size for file operations

boolean $sendHeaders

Indicates whether headers should be sent

boolean $attachment

Indicates whether the Content-disposition header should be set to 'attachment'

Warning: count(): Parameter must be an array or an object that implements Countable in phar://E:/source/CRM-VISIONLINE/3.4.2/Source/Website/build/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1376 Warning: count(): Parameter must be an array or an object that implements Countable in phar://E:/source/CRM-VISIONLINE/3.4.2/Source/Website/build/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1376

exec()

exec(integer|\Visionline\Crm\WebApi\QueryResult  $document, array  $stream_context_options, integer  $width = NULL, integer  $height = NULL, string  $resizeMode = NULL) : mixed

Executes the file operation

Parameters

integer|\Visionline\Crm\WebApi\QueryResult $document

The document to retrieve

array $stream_context_options

The stream context options

integer $width

The width to which an image should be resized

integer $height

The height to which an image should be resized

string $resizeMode

Specifies how an image should be resized

Throws

\InvalidArgumentException

If an invalid argument was supplied

\Exception

if an exception occured

Returns

mixed —

The result of this file operation

execMultiple()

execMultiple(array  $documents, array  $stream_context_options, integer  $width = NULL, integer  $height = NULL, string  $resizeMode = NULL) : mixed

Executes the file operation

Parameters

array $documents

The documents to retrieve

array $stream_context_options

The stream context options

integer $width

The width to which an image should be resized

integer $height

The height to which an image should be resized

string $resizeMode

Specifies how an image should be resized

Throws

\InvalidArgumentException

If an invalid argument was supplied

\Exception

if an exception occured

Returns

mixed —

The results of this file operation

process()

process(string  $data) 

Outputs the received data.

Parameters

string $data

The data

Warning: count(): Parameter must be an array or an object that implements Countable in phar://E:/source/CRM-VISIONLINE/3.4.2/Source/Website/build/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1376 Warning: count(): Parameter must be an array or an object that implements Countable in phar://E:/source/CRM-VISIONLINE/3.4.2/Source/Website/build/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1376

processMetaData()

processMetaData(integer  $id, integer  $width, integer  $height, string  $resizeMode, string  $contentType, string  $filename, string  $extension, integer  $lastModified) 

Sends the 'Content-type' and 'Content-disposition' headers if sendHeaders was set

Parameters

integer $id

The id of the entity

integer $width

The width to which an image should be resized

integer $height

The height to which an image should be resized

string $resizeMode

Specifies how an image should be resized

string $contentType

The content type of the file

string $filename

The filename of the file

string $extension

The file extension of the file

integer $lastModified

The timestamp of the last modification of the file

Warning: count(): Parameter must be an array or an object that implements Countable in phar://E:/source/CRM-VISIONLINE/3.4.2/Source/Website/build/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1376 Warning: count(): Parameter must be an array or an object that implements Countable in phar://E:/source/CRM-VISIONLINE/3.4.2/Source/Website/build/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1376

getResult()

getResult() : null

Returns null

Warning: count(): Parameter must be an array or an object that implements Countable in phar://E:/source/CRM-VISIONLINE/3.4.2/Source/Website/build/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1376 Warning: count(): Parameter must be an array or an object that implements Countable in phar://E:/source/CRM-VISIONLINE/3.4.2/Source/Website/build/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1376

Returns

null

shouldDownload()

shouldDownload(\Visionline\Crm\WebApi\QueryResult  $document, integer  $width, integer  $height, string  $resizeMode) : true

Returns true

Parameters

\Visionline\Crm\WebApi\QueryResult $document

The document in question

integer $width

The width to which an image should be resized

integer $height

The height to which an image should be resized

string $resizeMode

Specifies how an image should be resized

Warning: count(): Parameter must be an array or an object that implements Countable in phar://E:/source/CRM-VISIONLINE/3.4.2/Source/Website/build/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1376 Warning: count(): Parameter must be an array or an object that implements Countable in phar://E:/source/CRM-VISIONLINE/3.4.2/Source/Website/build/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1376

Returns

true

download()

download(integer  $id, integer  $width, integer  $height, string  $resizeMode, array  $stream_context_options, integer  $ifModifiedSince = null) 

Downloads the contents of the specified document

Parameters

integer $id

The id of the document

integer $width

The width to which an image should be resized

integer $height

The height to which an image should be resized

string $resizeMode

Specifies how an image should be resized

array $stream_context_options

The stream context options

integer $ifModifiedSince

If specified, the file is only downloaded if it was modified since $ifModifiedSince (timestamp)

Throws

\Exception

If an error occurs during download