Bitrix API

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
throws
ArgumentNullException

Add new agent for export products, albums or all

Return values
bool|int

deleteAgent()

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
throws
ArgumentNullException
throws
ArgumentOutOfRangeException
throws
SystemException
Return values
string

update()

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
Tags
throws
ArgumentNullException
Return values
bool|int

        
On this page

Search results