Vk extends Platform
Class Vk - manage VKontakte object - create, delete, install, uninstall, get and save settings etc.
Table of Contents
Constants
- DEFAULT_EXECUTION_ITEMS = 6
- DEFAULT_TIMELIMIT = 40
- GROUP_GET_STEP = 1000
- LINK_TYPE_PUBLIC_DETAIL_ORDER = 'PUBLIC_DETAIL_ORDER'
- LINK_TYPE_PUBLIC_FEEDBACK = 'PUBLIC_FEEDBACK'
- MAX_ALBUM_PHOTO_SIZE = 52428800
- MAX_ALBUM_PHOTO_SIZES_SUM = 14000
- MAX_ALBUM_RATIO_H = 3
- MAX_ALBUM_RATIO_V = 0.25
- MAX_ALBUMS = 100
- MAX_EXECUTION_ITEMS = 25
- MAX_PHOTOS_IN_ALBUM = 1
- MAX_PHOTOS_IN_PRODUCT = 4
- MAX_PRODUCT_PHOTO_SIZE = 52428800
- MAX_PRODUCT_PHOTO_SIZES_SUM = 14000
- MAX_PRODUCT_RATIO_H = 10
- MAX_PRODUCT_RATIO_V = 0.1
- MAX_PRODUCTS = 15000
- MAX_PRODUCTS_IN_ALBUM = 1000
- MAX_VK_CATEGORIES = 1000
- MIN_ALBUM_PHOTO_HEIGHT = 720
- MIN_ALBUM_PHOTO_WIDTH = 1280
- MIN_PRODUCT_PHOTO_HEIGHT = 400
- MIN_PRODUCT_PHOTO_WIDTH = 400
- OAUTH_URL = "https://oauth.vk.com/authorize"
- PRODUCTS_GET_STEP = 200
- TOKEN_URL = "https://oauth.vk.com/access_token"
- TRADING_PLATFORM_CODE = "vk"
- VERY_DEFAULT_VK_CATEGORY = 1
- VK_CATEGORY_TO_CHANGE = -1
- VK_URL = 'https://vk.com/'
- VK_URL__ALBUM_PREFIX = '?section=album_'
- VK_URL__MARKET_PREFIX = 'market-'
Methods
- addLogRecord() : bool
- changeActiveById() : mixed
- Change params and set ACTIVE flag to one export profile
- getAnalyticCode() : string
- getApi() : Api
- Return ore create new API object
- getAuthUrl() : bool|string
- Create URL for link to authorize in VK Oauth server
- getAvailableFlag() : mixed
- getCode() : string
- getExecuter() : Executer
- Return ore create new executer object
- getExecutionItemsLimit() : mixed
- Get max item count to export
- getExportProfilesList() : array<string|int, mixed>
- Return array of existings profiles IDs
- getExportTypes() : array<string|int, mixed>
- Return list of all possible exports type
- getExternalLink() : string
- getField() : mixed
- getGroupId() : bool
- Get VK-group ID from settings
- getId() : mixed
- getInfo() : array<string|int, mixed>
- getInstance() : Vk
- Return singltone object of VK
- getInstanceByCode() : Platform
- getRealName() : mixed
- getRichLog() : bool
- Return true if set option "Use rich log". Else return false.
- getScope() : int|mixed
- Return array of permissions to authorize in VK
- getSettings() : mixed
- Get settings from profiles table. If passed esportId - return only one item
- getTimelimit() : mixed
- Get timelimit from settings
- getTokenUrl() : bool|string
- Create link to getting access token
- install() : bool
- Installs all necessary stuff for Vk.
- isActive() : bool
- isActiveById() : bool
- Return value of ACTIVE flag to one export profile
- isAgressiveExport() : bool
- Return param Agressive_export
- isInstalled() : bool
- isOfType() : bool
- log() : bool
- Log events to system log & sends error to email.
- onAfterUpdateShipment() : mixed
- OnEventLogGetAuditTypes() : array<string|int, mixed>
- Error types for event log
- removeProfile() : DeleteResult
- Remove one export profile. If it last profile - uninstall all VK-platform
- resetSettings() : mixed
- saveSettings() : bool|int
- Formatted export profile settings and save them in own table.
- setActive() : bool
- Sets Vk active.
- setShipmentTableOnAfterUpdateEvent() : mixed
- uninstall() : bool
- Clear all items related with VK - settings, agents, mapping
- unsetActive() : bool
- Sets Vk inactive.
- unsetActiveById() : bool|int
- Unset ACTIVE flag to one export profile
Constants
DEFAULT_EXECUTION_ITEMS
public
mixed
DEFAULT_EXECUTION_ITEMS
= 6
DEFAULT_TIMELIMIT
public
mixed
DEFAULT_TIMELIMIT
= 40
GROUP_GET_STEP
public
mixed
GROUP_GET_STEP
= 1000
LINK_TYPE_PUBLIC_DETAIL_ORDER
public
mixed
LINK_TYPE_PUBLIC_DETAIL_ORDER
= 'PUBLIC_DETAIL_ORDER'
LINK_TYPE_PUBLIC_FEEDBACK
public
mixed
LINK_TYPE_PUBLIC_FEEDBACK
= 'PUBLIC_FEEDBACK'
MAX_ALBUM_PHOTO_SIZE
public
mixed
MAX_ALBUM_PHOTO_SIZE
= 52428800
MAX_ALBUM_PHOTO_SIZES_SUM
public
mixed
MAX_ALBUM_PHOTO_SIZES_SUM
= 14000
MAX_ALBUM_RATIO_H
public
mixed
MAX_ALBUM_RATIO_H
= 3
MAX_ALBUM_RATIO_V
public
mixed
MAX_ALBUM_RATIO_V
= 0.25
MAX_ALBUMS
public
mixed
MAX_ALBUMS
= 100
MAX_EXECUTION_ITEMS
public
mixed
MAX_EXECUTION_ITEMS
= 25
MAX_PHOTOS_IN_ALBUM
public
mixed
MAX_PHOTOS_IN_ALBUM
= 1
MAX_PHOTOS_IN_PRODUCT
public
mixed
MAX_PHOTOS_IN_PRODUCT
= 4
MAX_PRODUCT_PHOTO_SIZE
public
mixed
MAX_PRODUCT_PHOTO_SIZE
= 52428800
MAX_PRODUCT_PHOTO_SIZES_SUM
public
mixed
MAX_PRODUCT_PHOTO_SIZES_SUM
= 14000
MAX_PRODUCT_RATIO_H
public
mixed
MAX_PRODUCT_RATIO_H
= 10
MAX_PRODUCT_RATIO_V
public
mixed
MAX_PRODUCT_RATIO_V
= 0.1
MAX_PRODUCTS
public
mixed
MAX_PRODUCTS
= 15000
MAX_PRODUCTS_IN_ALBUM
public
mixed
MAX_PRODUCTS_IN_ALBUM
= 1000
MAX_VK_CATEGORIES
public
mixed
MAX_VK_CATEGORIES
= 1000
MIN_ALBUM_PHOTO_HEIGHT
public
mixed
MIN_ALBUM_PHOTO_HEIGHT
= 720
MIN_ALBUM_PHOTO_WIDTH
public
mixed
MIN_ALBUM_PHOTO_WIDTH
= 1280
MIN_PRODUCT_PHOTO_HEIGHT
public
mixed
MIN_PRODUCT_PHOTO_HEIGHT
= 400
MIN_PRODUCT_PHOTO_WIDTH
public
mixed
MIN_PRODUCT_PHOTO_WIDTH
= 400
OAUTH_URL
public
mixed
OAUTH_URL
= "https://oauth.vk.com/authorize"
PRODUCTS_GET_STEP
public
mixed
PRODUCTS_GET_STEP
= 200
TOKEN_URL
public
mixed
TOKEN_URL
= "https://oauth.vk.com/access_token"
TRADING_PLATFORM_CODE
public
mixed
TRADING_PLATFORM_CODE
= "vk"
VERY_DEFAULT_VK_CATEGORY
public
mixed
VERY_DEFAULT_VK_CATEGORY
= 1
VK_CATEGORY_TO_CHANGE
public
mixed
VK_CATEGORY_TO_CHANGE
= -1
VK_URL
public
mixed
VK_URL
= 'https://vk.com/'
VK_URL__ALBUM_PREFIX
public
mixed
VK_URL__ALBUM_PREFIX
= '?section=album_'
VK_URL__MARKET_PREFIX
public
mixed
VK_URL__MARKET_PREFIX
= 'market-'
Methods
addLogRecord()
public
addLogRecord(int $level, string $type, string $itemId, string $description) : bool
Parameters
- $level : int
-
The level of event.
- $type : string
-
Type of event.
- $itemId : string
-
Item idenifyer.
- $description : string
-
Description of event.
Return values
bool —Success or not.
changeActiveById()
Change params and set ACTIVE flag to one export profile
public
changeActiveById(mixed $exportId) : mixed
Parameters
- $exportId : mixed
getAnalyticCode()
public
getAnalyticCode() : string
Return values
string —Platform code.
getApi()
Return ore create new API object
public
getApi(mixed $exportId) : Api
Parameters
- $exportId : mixed
Return values
ApigetAuthUrl()
Create URL for link to authorize in VK Oauth server
public
getAuthUrl(mixed $exportId, mixed $redirectUrl) : bool|string
Parameters
- $exportId : mixed
- $redirectUrl : mixed
Return values
bool|stringgetAvailableFlag()
public
getAvailableFlag(mixed $exportId) : mixed
Parameters
- $exportId : mixed
getCode()
public
getCode() : string
Return values
string —Platform code.
getExecuter()
Return ore create new executer object
public
getExecuter(mixed $exportId) : Executer
Parameters
- $exportId : mixed
Return values
ExecutergetExecutionItemsLimit()
Get max item count to export
public
getExecutionItemsLimit(mixed $exportId) : mixed
Parameters
- $exportId : mixed
Return values
mixed —- max item count to export or false
getExportProfilesList()
Return array of existings profiles IDs
public
getExportProfilesList([mixed $onlyActive = true ]) : array<string|int, mixed>
@$onlyActive - if true - return only active profiles. If false - return all
Parameters
- $onlyActive : mixed = true
Tags
Return values
array<string|int, mixed>getExportTypes()
Return list of all possible exports type
public
static getExportTypes() : array<string|int, mixed>
Return values
array<string|int, mixed>getExternalLink()
public
getExternalLink(mixed $type, Order $order) : string
Parameters
- $type : mixed
- $order : Order
Return values
stringgetField()
public
getField(mixed $fieldName) : mixed
Parameters
- $fieldName : mixed
getGroupId()
Get VK-group ID from settings
public
getGroupId(mixed $exportId) : bool
Parameters
- $exportId : mixed
Return values
boolgetId()
public
getId() : mixed
Return values
mixed —Id of the current trading platform.
getInfo()
public
getInfo() : array<string|int, mixed>
Return values
array<string|int, mixed>getInstance()
Return singltone object of VK
public
static getInstance() : Vk
Tags
Return values
VkgetInstanceByCode()
public
static getInstanceByCode(mixed $code) : Platform
Parameters
- $code : mixed
Tags
Return values
PlatformgetRealName()
public
getRealName() : mixed
getRichLog()
Return true if set option "Use rich log". Else return false.
public
getRichLog(mixed $exportId) : bool
Rich log white more information about export, need for debug unknown errors.
Parameters
- $exportId : mixed
Return values
boolgetScope()
Return array of permissions to authorize in VK
public
static getScope(mixed $params) : int|mixed
Parameters
- $params : mixed
-
- array of needed permissions names
Return values
int|mixedgetSettings()
Get settings from profiles table. If passed esportId - return only one item
public
getSettings([null $exportId = NULL ]) : mixed
Parameters
- $exportId : null = NULL
Tags
getTimelimit()
Get timelimit from settings
public
getTimelimit(mixed $exportId) : mixed
Parameters
- $exportId : mixed
Return values
mixed —- timelimit or false
getTokenUrl()
Create link to getting access token
public
getTokenUrl(mixed $exportId, mixed $redirectUrl, mixed $code) : bool|string
Parameters
- $exportId : mixed
- $redirectUrl : mixed
- $code : mixed
Return values
bool|stringinstall()
Installs all necessary stuff for Vk.
public
install() : bool
Return values
boolisActive()
public
isActive() : bool
Return values
boolisActiveById()
Return value of ACTIVE flag to one export profile
public
isActiveById(mixed $exportId) : bool
Parameters
- $exportId : mixed
Return values
boolisAgressiveExport()
Return param Agressive_export
public
isAgressiveExport(mixed $exportId) : bool
Parameters
- $exportId : mixed
Return values
boolisInstalled()
public
isInstalled() : bool
Return values
bool —Is platfom installed?.
isOfType()
public
isOfType(string $type) : bool
Parameters
- $type : string
Return values
boollog()
Log events to system log & sends error to email.
public
log(int $level, string $type, string $itemId, string $description) : bool
Parameters
- $level : int
-
Log level of event.
- $type : string
-
Event type.
- $itemId : string
-
Item id.
- $description : string
-
Event description.
Return values
boolonAfterUpdateShipment()
public
static onAfterUpdateShipment(Event $event, array<string|int, mixed> $additional) : mixed
Parameters
- $event : Event
- $additional : array<string|int, mixed>
OnEventLogGetAuditTypes()
Error types for event log
public
static OnEventLogGetAuditTypes() : array<string|int, mixed>
Return values
array<string|int, mixed>removeProfile()
Remove one export profile. If it last profile - uninstall all VK-platform
public
removeProfile(mixed $exportId) : DeleteResult
Parameters
- $exportId : mixed
Tags
Return values
DeleteResultresetSettings()
public
resetSettings(mixed $siteId) : mixed
Parameters
- $siteId : mixed
saveSettings()
Formatted export profile settings and save them in own table.
public
saveSettings(array<string|int, mixed> $settings) : bool|int
Parameters
- $settings : array<string|int, mixed>
Tags
Return values
bool|intsetActive()
Sets Vk active.
public
setActive() : bool
Tags
Return values
boolsetShipmentTableOnAfterUpdateEvent()
public
static setShipmentTableOnAfterUpdateEvent() : mixed
uninstall()
Clear all items related with VK - settings, agents, mapping
public
uninstall() : bool
Tags
Return values
bool —Is deletion successful?.
unsetActive()
Sets Vk inactive.
public
unsetActive() : bool
Return values
boolunsetActiveById()
Unset ACTIVE flag to one export profile
public
unsetActiveById(mixed $exportId) : bool|int
Parameters
- $exportId : mixed