Bitrix API

SubscribeManager

Class SubscribeManager manages subscriptions.

Table of Contents

Constants

ERROR_ACTIVITY_CHANGE  = 'ERROR_ACTIVITY_CHANGE_12008'
ERROR_ADD_SUBSCRIBE  = 'ERROR_ADD_SUBSCRIBE_12002'
ERROR_ADD_SUBSCRIBE_ALREADY_EXISTS  = 'ERROR_ADD_SUBSCRIBE_ALREADY_EXISTS_12007'
ERROR_AUTHORIZATION  = 'ERROR_AUTHORIZATION_12005'
ERROR_DELETE_SUBSCRIBE  = 'ERROR_ADD_SUBSCRIBE_12006'
ERROR_REQUIRED_PARAMATERS  = 'ERROR_REQUIRED_PARAMATERS_12001'
ERROR_SUBSCRIBER_IDENTIFICATION  = 'ERROR_SUBSCRIBER_IDENTIFICATION_12004'
ERROR_UNSUBSCRIBE  = 'ERROR_UNSUBSCRIBE_12009'
ERROR_VALIDATE_FIELDS  = 'ERROR_VALIDATE_FIELDS_12003'

Properties

$contactTypes  : mixed

Methods

__construct()  : mixed
activateSubscription()  : bool
The method activates the subscription clearing a field DATE_TO or writing the subscription term.
addSubscribe()  : bool|int
The method creates a new subscription.
authorizeSubscriber()  : bool
The method authenticates an anonymous subscriber.
checkAccessToSubscription()  : bool
The method checks the access to subscription by using the userId or token.
checkSubscriptionActivity()  : bool
The method checks the subscription activity field value DATE_TO.
deactivateSubscription()  : bool
The method deactivates the subscription by writing the current date.
deleteManySubscriptions()  : bool
The method removes a lot of subscriptions received subscribeId list with the account permissions.
getErrors()  : array<string|int, mixed>
runSubscriberIdentification()  : bool
The method begins the process of identification of the anonymous subscriber.
setSessionOfSibscribedProducts()  : void
Write product id to the session to check that the user has subscribed.
unSubscribe()  : bool
Method unsubscribe subscribers with fixed input data.

Constants

ERROR_ACTIVITY_CHANGE

public mixed ERROR_ACTIVITY_CHANGE = 'ERROR_ACTIVITY_CHANGE_12008'

ERROR_ADD_SUBSCRIBE

public mixed ERROR_ADD_SUBSCRIBE = 'ERROR_ADD_SUBSCRIBE_12002'

ERROR_ADD_SUBSCRIBE_ALREADY_EXISTS

public mixed ERROR_ADD_SUBSCRIBE_ALREADY_EXISTS = 'ERROR_ADD_SUBSCRIBE_ALREADY_EXISTS_12007'

ERROR_AUTHORIZATION

public mixed ERROR_AUTHORIZATION = 'ERROR_AUTHORIZATION_12005'

ERROR_DELETE_SUBSCRIBE

public mixed ERROR_DELETE_SUBSCRIBE = 'ERROR_ADD_SUBSCRIBE_12006'

ERROR_REQUIRED_PARAMATERS

public mixed ERROR_REQUIRED_PARAMATERS = 'ERROR_REQUIRED_PARAMATERS_12001'

ERROR_SUBSCRIBER_IDENTIFICATION

public mixed ERROR_SUBSCRIBER_IDENTIFICATION = 'ERROR_SUBSCRIBER_IDENTIFICATION_12004'

ERROR_UNSUBSCRIBE

public mixed ERROR_UNSUBSCRIBE = 'ERROR_UNSUBSCRIBE_12009'

ERROR_VALIDATE_FIELDS

public mixed ERROR_VALIDATE_FIELDS = 'ERROR_VALIDATE_FIELDS_12003'

Properties

Methods

activateSubscription()

The method activates the subscription clearing a field DATE_TO or writing the subscription term.

public activateSubscription(array<string|int, mixed> $listSubscribeId[, int $timePeriod = 0 ]) : bool
Parameters
$listSubscribeId : array<string|int, mixed>

List subscribe id.

$timePeriod : int = 0

Subscription period in seconds.

Tags
throws
Exception
Return values
bool

addSubscribe()

The method creates a new subscription.

public addSubscribe(array<string|int, mixed> $subscribeData) : bool|int
Parameters
$subscribeData : array<string|int, mixed>

An array containing the data of a new subscription.

Tags
throws
ArgumentException
throws
ArgumentNullException
throws
Exception
Return values
bool|int

authorizeSubscriber()

The method authenticates an anonymous subscriber.

public authorizeSubscriber(array<string|int, mixed> $authorizationData) : bool
Parameters
$authorizationData : array<string|int, mixed>

The authentication information.

Return values
bool

checkAccessToSubscription()

The method checks the access to subscription by using the userId or token.

public checkAccessToSubscription(int $subscribeId) : bool

Administrators subscription is always available.

Parameters
$subscribeId : int

Subscribe id.

Tags
throws
ArgumentException
Return values
bool

checkSubscriptionActivity()

The method checks the subscription activity field value DATE_TO.

public checkSubscriptionActivity(mixed $dateTo) : bool
Parameters
$dateTo : mixed

An empty value or an instance DateTime.

Return values
bool

deactivateSubscription()

The method deactivates the subscription by writing the current date.

public deactivateSubscription(array<string|int, mixed> $listSubscribeId) : bool
Parameters
$listSubscribeId : array<string|int, mixed>

List subscribe id.

Tags
throws
Exception
Return values
bool

deleteManySubscriptions()

The method removes a lot of subscriptions received subscribeId list with the account permissions.

public deleteManySubscriptions(array<string|int, mixed> $listSubscribeId[, int $itemId = 0 ]) : bool
Parameters
$listSubscribeId : array<string|int, mixed>

List subscribe id.

$itemId : int = 0

If this parameter is passed, cleaned write to the session.

Tags
throws
Exception
Return values
bool

getErrors()

public getErrors() : array<string|int, mixed>
Return values
array<string|int, mixed>

An array containing Error objects.

runSubscriberIdentification()

The method begins the process of identification of the anonymous subscriber.

public runSubscriberIdentification(array<string|int, mixed> $subscriberData[, bool $sendLetter = true ]) : bool
Parameters
$subscriberData : array<string|int, mixed>

An array containing the data necessary for identification.

$sendLetter : bool = true

Marker, checks whether to send a letter.

Tags
throws
ArgumentNullException
Return values
bool

setSessionOfSibscribedProducts()

Write product id to the session to check that the user has subscribed.

public setSessionOfSibscribedProducts(int $itemId) : void
Parameters
$itemId : int

Product id.

unSubscribe()

Method unsubscribe subscribers with fixed input data.

public unSubscribe(array<string|int, mixed> $data) : bool
Parameters
$data : array<string|int, mixed>

Input data.

Tags
throws
ArgumentException
throws
Exception
Return values
bool

        
On this page

Search results