Agent
Class Agent Working with agent for VK-export: running, update, delete. Provide multistep processing.
Table of Contents
Methods
- add() : bool|int
- deleteAgent() : mixed
- Delete agent by ID
- deleteAll() : mixed
- Remove all agents, saving in VK settings
- getExistingOnceAgent() : array<string|int, mixed>
- Find vk-export agents which running once.
- getRunningPereodicalAgents() : array<string|int, mixed>
- Find vk-export agents which was running but not finished (have not null start position) Return array of IDs.
- start() : string
- Starting agents from start position. Need for multisteps.
- update() : bool|int
- Update params for existing agent. If agent if not exist - create new
Methods
add()
public
static add(mixed $feedType, mixed $exportId[, string $startPosition = "" ], mixed $interval[, bool $once = false ]) : bool|int
Parameters
- $feedType : mixed
-
- type of export. May be ALL - then after ending ALBUMS export will be created PRODUCTS agent
- $exportId : mixed
- $startPosition : string = ""
-
- in first run must be ""
- $interval : mixed
-
- time of repeating
- $once : bool = false
-
- if true - agent will be deleted after ending process
Tags
Return values
bool|intdeleteAgent()
Delete agent by ID
public
static deleteAgent(mixed $agentId) : mixed
Parameters
- $agentId : mixed
deleteAll()
Remove all agents, saving in VK settings
public
static deleteAll() : mixed
getExistingOnceAgent()
Find vk-export agents which running once.
public
static getExistingOnceAgent(mixed $feedType, mixed $exportId) : array<string|int, mixed>
Return array of IDs.
Parameters
- $feedType : mixed
-
- type of export. May be ALL - then after ending ALBUMS export will be created PRODUCTS agent
- $exportId : mixed
Return values
array<string|int, mixed> —- IDs of existing agents
getRunningPereodicalAgents()
Find vk-export agents which was running but not finished (have not null start position) Return array of IDs.
public
static getRunningPereodicalAgents(mixed $feedType, mixed $exportId) : array<string|int, mixed>
Parameters
- $feedType : mixed
- $exportId : mixed
Return values
array<string|int, mixed>start()
Starting agents from start position. Need for multisteps.
public
static start(mixed $feedType, mixed $exportId[, string $startPosition = "" ][, bool $once = false ][, int $execNumber = 1 ]) : string
Parameters
- $feedType : mixed
-
- type of export. May be ALL - then after ending ALBUMS export will be created PRODUCTS agent
- $exportId : mixed
- $startPosition : string = ""
-
- in first run must be ""
- $once : bool = false
-
- if true - agent will be deleted after ending process
- $execNumber : int = 1
-
- number of repeated running without changing position. Need for alert of slow agent.
Tags
Return values
stringupdate()
Update params for existing agent. If agent if not exist - create new
public
static update(mixed $exportId, mixed $feedType, mixed $interval[, bool $once = false ]) : bool|int
Parameters
- $exportId : mixed
- $feedType : mixed
-
- type of export. May be ALL - then after ending ALBUMS export will be created PRODUCTS agent
- $interval : mixed
-
- time of repeating
- $once : bool = false
-
- if true - agent will be deleted after ending process