FormVkontakte extends Form
Class FormVkontakte
Table of Contents
Constants
- FIELD_MAP = [['CRM_NAME' => \Bitrix\Seo\LeadAds\Field::TYPE_NAME, 'ADS_NAME' => 'first_name'], ['CRM_NAME' => \Bitrix\Seo\LeadAds\Field::TYPE_LAST_NAME, 'ADS_NAME' => 'last_name'], ['CRM_NAME' => \Bitrix\Seo\LeadAds\Field::TYPE_EMAIL, 'ADS_NAME' => 'email'], ['CRM_NAME' => \Bitrix\Seo\LeadAds\Field::TYPE_PHONE, 'ADS_NAME' => 'phone'], ['CRM_NAME' => \Bitrix\Seo\LeadAds\Field::TYPE_BIRTHDAY, 'ADS_NAME' => 'birth_date'], ['CRM_NAME' => \Bitrix\Seo\LeadAds\Field::TYPE_AGE, 'ADS_NAME' => 'age'], ['CRM_NAME' => \Bitrix\Seo\LeadAds\Field::TYPE_LOCATION_FULL, 'ADS_NAME' => 'location'], ['CRM_NAME' => \Bitrix\Seo\LeadAds\Field::TYPE_PATRONYMIC_NAME, 'ADS_NAME' => 'patronymic_name'], ['CRM_NAME' => \Bitrix\Seo\LeadAds\Field::TYPE_LOCATION_COUNTRY, 'ADS_NAME' => 'country'], ['CRM_NAME' => \Bitrix\Seo\LeadAds\Field::TYPE_LOCATION_CITY, 'ADS_NAME' => 'city'], ['CRM_NAME' => \Bitrix\Seo\LeadAds\Field::TYPE_LOCATION_STREET_ADDRESS, 'ADS_NAME' => 'address'], ['CRM_NAME' => \Bitrix\Seo\LeadAds\Field::TYPE_INPUT, 'ADS_NAME' => 'question']]
- LIMIT_DEFAULT = 20
- LIMIT_MAX = 50
- TYPE_CODE = \Bitrix\Seo\LeadAds\Service::TYPE_VKONTAKTE
- URL_FORM_LIST = 'https://www.facebook.com/ads/manager/audiences/manage/'
- USE_GROUP_AUTH = true
Methods
- __construct() : mixed
- Form constructor.
- add() : Response
- Add.
- convertField() : array<string|int, mixed>
- Convert field.
- convertFields() : array<string|int, mixed>
- Convert fields.
- create() : static
- getAccountId() : string|null
- getForm() : FormResponse
- getGroupAuthAdapter() : AuthAdapter|null
- Get group auth adapter.
- getList() : FormResponse
- Get list.
- getPrivacyPolicyUrl() : string
- Get privacy policy url.
- getRegisteredGroups() : array<string|int, string>
- Get registered groups.
- getRequest() : Request
- getResult() : Result
- Get result.
- getUrlFormList() : string
- Get form list url.
- isGroupAuthUsed() : bool
- Return true if group auth used.
- isSupportAccount() : bool
- Is account supported.
- loadLeads() : Result
- normalizeListRow() : mixed
- register() : Response
- Register WebHook
- registerGroup() : bool
- Register group.
- setAccountId() : self
- Set account id.
- setRequest() : mixed
- setService() : mixed
- unlink() : bool
- Unlink
- unregisterForm() : bool
- unregisterForms() : mixed
- unRegisterGroup() : bool
- UnRegister group.
Constants
FIELD_MAP
public
mixed
FIELD_MAP
= [['CRM_NAME' => \Bitrix\Seo\LeadAds\Field::TYPE_NAME, 'ADS_NAME' => 'first_name'], ['CRM_NAME' => \Bitrix\Seo\LeadAds\Field::TYPE_LAST_NAME, 'ADS_NAME' => 'last_name'], ['CRM_NAME' => \Bitrix\Seo\LeadAds\Field::TYPE_EMAIL, 'ADS_NAME' => 'email'], ['CRM_NAME' => \Bitrix\Seo\LeadAds\Field::TYPE_PHONE, 'ADS_NAME' => 'phone'], ['CRM_NAME' => \Bitrix\Seo\LeadAds\Field::TYPE_BIRTHDAY, 'ADS_NAME' => 'birth_date'], ['CRM_NAME' => \Bitrix\Seo\LeadAds\Field::TYPE_AGE, 'ADS_NAME' => 'age'], ['CRM_NAME' => \Bitrix\Seo\LeadAds\Field::TYPE_LOCATION_FULL, 'ADS_NAME' => 'location'], ['CRM_NAME' => \Bitrix\Seo\LeadAds\Field::TYPE_PATRONYMIC_NAME, 'ADS_NAME' => 'patronymic_name'], ['CRM_NAME' => \Bitrix\Seo\LeadAds\Field::TYPE_LOCATION_COUNTRY, 'ADS_NAME' => 'country'], ['CRM_NAME' => \Bitrix\Seo\LeadAds\Field::TYPE_LOCATION_CITY, 'ADS_NAME' => 'city'], ['CRM_NAME' => \Bitrix\Seo\LeadAds\Field::TYPE_LOCATION_STREET_ADDRESS, 'ADS_NAME' => 'address'], ['CRM_NAME' => \Bitrix\Seo\LeadAds\Field::TYPE_INPUT, 'ADS_NAME' => 'question']]
LIMIT_DEFAULT
public
mixed
LIMIT_DEFAULT
= 20
LIMIT_MAX
public
mixed
LIMIT_MAX
= 50
TYPE_CODE
public
mixed
TYPE_CODE
= \Bitrix\Seo\LeadAds\Service::TYPE_VKONTAKTE
URL_FORM_LIST
public
mixed
URL_FORM_LIST
= 'https://www.facebook.com/ads/manager/audiences/manage/'
USE_GROUP_AUTH
public
mixed
USE_GROUP_AUTH
= true
Methods
__construct()
Form constructor.
public
__construct([string|null $accountId = null ]) : mixed
Parameters
- $accountId : string|null = null
-
Account ID.
add()
Add.
public
add(array<string|int, mixed> $data) : Response
Parameters
- $data : array<string|int, mixed>
Tags
Return values
ResponseconvertField()
Convert field.
public
static convertField(Field $field) : array<string|int, mixed>
Parameters
- $field : Field
-
Field.
Return values
array<string|int, mixed>convertFields()
Convert fields.
public
static convertFields(array<string|int, Field> $fields) : array<string|int, mixed>
Parameters
- $fields : array<string|int, Field>
-
Fields.
Return values
array<string|int, mixed>create()
public
static create(mixed $type[, null $parameters = null ][, IService|null $service = null ]) : static
Parameters
- $type : mixed
- $parameters : null = null
- $service : IService|null = null
Return values
staticgetAccountId()
public
getAccountId() : string|null
Return values
string|nullgetForm()
public
getForm(mixed $formId) : FormResponse
Parameters
- $formId : mixed
Tags
Return values
FormResponsegetGroupAuthAdapter()
Get group auth adapter.
public
getGroupAuthAdapter() : AuthAdapter|null
Return values
AuthAdapter|nullgetList()
Get list.
public
getList() : FormResponse
Tags
Return values
FormResponsegetPrivacyPolicyUrl()
Get privacy policy url.
public
static getPrivacyPolicyUrl() : string
Return values
stringgetRegisteredGroups()
Get registered groups.
public
getRegisteredGroups() : array<string|int, string>
Tags
Return values
array<string|int, string>getRequest()
public
getRequest() : Request
Return values
RequestgetResult()
Get result.
public
getResult(LeadItem $item) : Result
Parameters
- $item : LeadItem
-
Payload item instance.
Return values
ResultgetUrlFormList()
Get form list url.
public
static getUrlFormList() : string
Return values
stringisGroupAuthUsed()
Return true if group auth used.
public
static isGroupAuthUsed() : bool
Return values
boolisSupportAccount()
Is account supported.
public
static isSupportAccount() : bool
Return values
boolloadLeads()
public
loadLeads(mixed $formId) : Result
Parameters
- $formId : mixed
Return values
ResultnormalizeListRow()
public
static normalizeListRow(array<string|int, mixed> $row) : mixed
Parameters
- $row : array<string|int, mixed>
register()
Register WebHook
public
register(string $formId) : Response
Parameters
- $formId : string
-
ads-form ID
Return values
ResponseregisterGroup()
Register group.
public
registerGroup(string $groupId) : bool
Parameters
- $groupId : string
-
Group ID.
Return values
boolsetAccountId()
Set account id.
public
setAccountId(string $accountId) : self
Parameters
- $accountId : string
-
Account ID.
Return values
selfsetRequest()
public
setRequest(Request $request) : mixed
Parameters
- $request : Request
setService()
public
setService(IService $service) : mixed
Parameters
- $service : IService
unlink()
Unlink
public
unlink(string $id) : bool
Parameters
- $id : string
-
ID.
Return values
boolunregisterForm()
public
unregisterForm(mixed $adsFormId) : bool
Parameters
- $adsFormId : mixed
Return values
boolunregisterForms()
public
unregisterForms() : mixed
unRegisterGroup()
UnRegister group.
public
unRegisterGroup(string $groupId) : bool
Parameters
- $groupId : string
-
Group ID.