Documentation

Scanner
in package

Scanner class for Epson Connect PHP.

This class handles the interaction with the Epson Connect API for scanning tasks. It includes methods for listing, adding, updating, and removing scan destinations.

Table of Contents

VALID_DESTINATION_TYPES  = ['mail', 'url']
$_auth  : mixed
$_destination_cache  : mixed
$_path  : mixed
__construct()  : mixed
Constructor for the Scanner class.
add()  : array<string|int, mixed>
Adds a new scan destination.
list()  : array<string|int, mixed>
Lists all scan destinations.
remove()  : mixed
Removes a scan destination.
update()  : array<string|int, mixed>
Updates an existing scan destination.
_validate_destination()  : mixed
Validates a scan destination.

Constants

VALID_DESTINATION_TYPES

public mixed VALID_DESTINATION_TYPES = ['mail', 'url']

Properties

$_destination_cache

private mixed $_destination_cache = []

Methods

__construct()

Constructor for the Scanner class.

public __construct(Auth $auth) : mixed
Parameters
$auth : Auth

An instance of the Auth class for authentication.

Return values
mixed

add()

Adds a new scan destination.

public add(string $name, string $destination[, string $type = 'mail' ]) : array<string|int, mixed>
Parameters
$name : string

The name of the scan destination.

$destination : string

The destination of the scan.

$type : string = 'mail'

The type of the scan destination. Default is 'mail'.

Tags
throws
Exception

If the destination name or destination is too long, or if the type is invalid.

Return values
array<string|int, mixed>

The response from the API.

list()

Lists all scan destinations.

public list() : array<string|int, mixed>
Return values
array<string|int, mixed>

The list of scan destinations.

remove()

Removes a scan destination.

public remove(string $id) : mixed
Parameters
$id : string

The ID of the scan destination to remove.

Return values
mixed

update()

Updates an existing scan destination.

public update(string $id[, string|null $name = null ][, string|null $destination = null ][, string|null $type = null ]) : array<string|int, mixed>
Parameters
$id : string

The ID of the scan destination to update.

$name : string|null = null

The new name of the scan destination. If null, the existing name is used.

$destination : string|null = null

The new destination of the scan. If null, the existing destination is used.

$type : string|null = null

The new type of the scan destination. If null, the existing type is used.

Tags
throws
Exception

If the destination is not registered, or if the destination name or destination is too long, or if the type is invalid.

Return values
array<string|int, mixed>

The response from the API.

_validate_destination()

Validates a scan destination.

private _validate_destination(string $name, string $destination, string $type) : mixed
Parameters
$name : string

The name of the scan destination.

$destination : string

The destination of the scan.

$type : string

The type of the scan destination.

Tags
throws
Exception

If the destination name or destination is too long, or if the type is invalid.

Return values
mixed

Search results