\Visionline\Crm\WebApiFileGetOperation

Internal class that defines the file-operation "get"

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
$data
N/A

Properties

$getFileUrl

$getFileUrl : string

The URL from which to get files

Type

string

$bufferSize

$bufferSize : integer

The buffer size

Type

integer

$data

$data : string

The downloaded data.

Type

string

Methods

__construct()

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

Create a get file operation

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

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) 

Appends the retrieved data to the internal buffer.

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) 

Does nothing.

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() : string

Returns the internal buffer

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

string —

The internal buffer

shouldDownload()

shouldDownload(\Visionline\Crm\WebApi\QueryResult  $document, integer  $width, integer  $height, string  $resizeMode) : \Visionline\Crm\WebApi\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

\Visionline\Crm\WebApi\true, —

if the file should be downloaded; false, if the file should not be downloaded; or a timestamp if the file should be downloaded if it is newer than this timestamp

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