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
$_auth
private
mixed
$_auth
$_destination_cache
private
mixed
$_destination_cache
= []
$_path
private
mixed
$_path
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
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
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.