FormFacebook extends Form
Table of Contents
Constants
- FIELD_MAP = [['CRM_NAME' => \Bitrix\Seo\LeadAds\Field::TYPE_COMPANY_NAME, 'ADS_NAME' => 'COMPANY_NAME'], ['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_WORK_EMAIL, 'ADS_NAME' => 'WORK_EMAIL'], ['CRM_NAME' => \Bitrix\Seo\LeadAds\Field::TYPE_WORK_PHONE, 'ADS_NAME' => 'WORK_PHONE_NUMBER'], ['CRM_NAME' => \Bitrix\Seo\LeadAds\Field::TYPE_JOB_TITLE, 'ADS_NAME' => 'JOB_TITLE'], ['CRM_NAME' => \Bitrix\Seo\LeadAds\Field::TYPE_MILITARY_STATUS, 'ADS_NAME' => 'MILITARY_STATUS'], ['CRM_NAME' => \Bitrix\Seo\LeadAds\Field::TYPE_MARITIAL_STATUS, 'ADS_NAME' => 'MARITIAL_STATUS'], ['CRM_NAME' => \Bitrix\Seo\LeadAds\Field::TYPE_GENDER, 'ADS_NAME' => 'GENDER'], ['CRM_NAME' => \Bitrix\Seo\LeadAds\Field::TYPE_BIRTHDAY, 'ADS_NAME' => 'DOB'], ['CRM_NAME' => \Bitrix\Seo\LeadAds\Field::TYPE_LOCATION_COUNTRY, 'ADS_NAME' => 'COUNTRY'], ['CRM_NAME' => \Bitrix\Seo\LeadAds\Field::TYPE_LOCATION_STATE, 'ADS_NAME' => 'STATE'], ['CRM_NAME' => \Bitrix\Seo\LeadAds\Field::TYPE_LOCATION_CITY, 'ADS_NAME' => 'CITY'], ['CRM_NAME' => \Bitrix\Seo\LeadAds\Field::TYPE_LOCATION_STREET_ADDRESS, 'ADS_NAME' => 'STREET_ADDRESS'], ['CRM_NAME' => \Bitrix\Seo\LeadAds\Field::TYPE_FULL_NAME, 'ADS_NAME' => 'FULL_NAME'], ['CRM_NAME' => \Bitrix\Seo\LeadAds\Field::TYPE_LOCATION_ZIP, 'ADS_NAME' => 'ZIP'], ['CRM_NAME' => \Bitrix\Seo\LeadAds\Field::TYPE_RELATIONSHIP_STATUS, 'ADS_NAME' => 'RELATIONSHIP_STATUS'], ['CRM_NAME' => \Bitrix\Seo\LeadAds\Field::TYPE_CPF, 'ADS_NAME' => 'ID_CPF'], ['CRM_NAME' => \Bitrix\Seo\LeadAds\Field::TYPE_DNI_ARGENTINA, 'ADS_NAME' => 'ID_AR_DNI'], ['CRM_NAME' => \Bitrix\Seo\LeadAds\Field::TYPE_DNI_PERU, 'ADS_NAME' => 'ID_PE_DNI'], ['CRM_NAME' => \Bitrix\Seo\LeadAds\Field::TYPE_RUT, 'ADS_NAME' => 'ID_CL_RUT'], ['CRM_NAME' => \Bitrix\Seo\LeadAds\Field::TYPE_CC, 'ADS_NAME' => 'ID_CO_CC'], ['CRM_NAME' => \Bitrix\Seo\LeadAds\Field::TYPE_CI, 'ADS_NAME' => 'ID_EC_CI'], ['CRM_NAME' => \Bitrix\Seo\LeadAds\Field::TYPE_DATE_TIME, 'ADS_NAME' => 'DATE_TIME']]
- TYPE_CODE = \Bitrix\Seo\LeadAds\Service::TYPE_FACEBOOK
- URL_FORM_LIST = 'https://www.facebook.com/ads/manager/audiences/manage/'
- USE_GROUP_AUTH = false
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_COMPANY_NAME, 'ADS_NAME' => 'COMPANY_NAME'], ['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_WORK_EMAIL, 'ADS_NAME' => 'WORK_EMAIL'], ['CRM_NAME' => \Bitrix\Seo\LeadAds\Field::TYPE_WORK_PHONE, 'ADS_NAME' => 'WORK_PHONE_NUMBER'], ['CRM_NAME' => \Bitrix\Seo\LeadAds\Field::TYPE_JOB_TITLE, 'ADS_NAME' => 'JOB_TITLE'], ['CRM_NAME' => \Bitrix\Seo\LeadAds\Field::TYPE_MILITARY_STATUS, 'ADS_NAME' => 'MILITARY_STATUS'], ['CRM_NAME' => \Bitrix\Seo\LeadAds\Field::TYPE_MARITIAL_STATUS, 'ADS_NAME' => 'MARITIAL_STATUS'], ['CRM_NAME' => \Bitrix\Seo\LeadAds\Field::TYPE_GENDER, 'ADS_NAME' => 'GENDER'], ['CRM_NAME' => \Bitrix\Seo\LeadAds\Field::TYPE_BIRTHDAY, 'ADS_NAME' => 'DOB'], ['CRM_NAME' => \Bitrix\Seo\LeadAds\Field::TYPE_LOCATION_COUNTRY, 'ADS_NAME' => 'COUNTRY'], ['CRM_NAME' => \Bitrix\Seo\LeadAds\Field::TYPE_LOCATION_STATE, 'ADS_NAME' => 'STATE'], ['CRM_NAME' => \Bitrix\Seo\LeadAds\Field::TYPE_LOCATION_CITY, 'ADS_NAME' => 'CITY'], ['CRM_NAME' => \Bitrix\Seo\LeadAds\Field::TYPE_LOCATION_STREET_ADDRESS, 'ADS_NAME' => 'STREET_ADDRESS'], ['CRM_NAME' => \Bitrix\Seo\LeadAds\Field::TYPE_FULL_NAME, 'ADS_NAME' => 'FULL_NAME'], ['CRM_NAME' => \Bitrix\Seo\LeadAds\Field::TYPE_LOCATION_ZIP, 'ADS_NAME' => 'ZIP'], ['CRM_NAME' => \Bitrix\Seo\LeadAds\Field::TYPE_RELATIONSHIP_STATUS, 'ADS_NAME' => 'RELATIONSHIP_STATUS'], ['CRM_NAME' => \Bitrix\Seo\LeadAds\Field::TYPE_CPF, 'ADS_NAME' => 'ID_CPF'], ['CRM_NAME' => \Bitrix\Seo\LeadAds\Field::TYPE_DNI_ARGENTINA, 'ADS_NAME' => 'ID_AR_DNI'], ['CRM_NAME' => \Bitrix\Seo\LeadAds\Field::TYPE_DNI_PERU, 'ADS_NAME' => 'ID_PE_DNI'], ['CRM_NAME' => \Bitrix\Seo\LeadAds\Field::TYPE_RUT, 'ADS_NAME' => 'ID_CL_RUT'], ['CRM_NAME' => \Bitrix\Seo\LeadAds\Field::TYPE_CC, 'ADS_NAME' => 'ID_CO_CC'], ['CRM_NAME' => \Bitrix\Seo\LeadAds\Field::TYPE_CI, 'ADS_NAME' => 'ID_EC_CI'], ['CRM_NAME' => \Bitrix\Seo\LeadAds\Field::TYPE_DATE_TIME, 'ADS_NAME' => 'DATE_TIME']]
TYPE_CODE
public
mixed
TYPE_CODE
= \Bitrix\Seo\LeadAds\Service::TYPE_FACEBOOK
URL_FORM_LIST
public
mixed
URL_FORM_LIST
= 'https://www.facebook.com/ads/manager/audiences/manage/'
USE_GROUP_AUTH
public
mixed
USE_GROUP_AUTH
= false
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>
-
Data.
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
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|int|mixed $formId) : Response
Parameters
- $formId : string|int|mixed
-
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.