1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
service.php
См. документацию.
1<?
2
3namespace Bitrix\Seo\Marketing;
4
5use Bitrix\Main\Config\Option;
6use Bitrix\Seo\BusinessSuite\IInternalService;
7use Bitrix\Seo\Retargeting\AuthAdapter;
8use Bitrix\Seo\Retargeting\IMultiClientService;
9use Bitrix\Seo\Retargeting\IService;
10
17{
18 const GROUP = 'marketing';
19 const TYPE_FACEBOOK = 'facebook';
20 const TYPE_INSTAGRAM = 'instagram';
21 protected $clientId;
22
28 public static function getInstance()
29 {
30 static $instance = null;
31 if ($instance === null)
32 {
33 $instance = new static();
34 }
35
36 return $instance;
37 }
38
46 public static function getEngineCode($type)
47 {
48 return static::GROUP.'.'.$type;
49 }
50
58 public static function getAccount($type)
59 {
60 static $account = null;
61 if ($account === null)
62 {
63 $account = Account::create($type)
64 ->setService(static::getInstance());
65 }
66
67 return $account;
68 }
69
76 public static function createCampaign($type, array $data)
77 {
79 ->setService(static::getInstance())
80 ->createCampaign($data);
81 }
82
89 public static function createAudience($type, array $data)
90 {
92 ->setService(static::getInstance())
93 ->add($data);
94 }
95
102 public static function getPostList($type, $params)
103 {
104 return PostList::create($type)
105 ->setService(static::getInstance())
106 ->getList($params);
107 }
108
114 public static function getAudience($type)
115 {
116 return Audience::create($type)
117 ->setService(static::getInstance());
118 }
119
126 public static function getAudienceList($type, $accountId)
127 {
128 return Audience::create($type)
129 ->setService(static::getInstance())
130 ->getList($accountId);
131 }
132
139 public static function getAdSetList($type, $accountId)
140 {
142 ->setService(static::getInstance())
143 ->getAdSetList($accountId);
144 }
145
152 public static function getAds($type, $adsId)
153 {
155 ->setService(static::getInstance())
156 ->getAds($adsId);
157 }
158
165 public static function searchTargetingData($type, $params)
166 {
168 ->setService(static::getInstance())
169 ->searchTargetingData($params);
170 }
171
178 public static function getCampaignList($type, $accountId)
179 {
181 ->setService(static::getInstance())
182 ->getCampaignList($accountId);
183 }
184
190 public static function getTypes()
191 {
192 return [
193 static::TYPE_FACEBOOK,
194 static::TYPE_INSTAGRAM,
195 ];
196 }
197
205 public static function getAuthAdapter($type)
206 {
207 return AuthAdapter::create($type)
208 ->setService(static::getInstance());
209 }
210
215 public function getClientId()
216 {
217 return $this->clientId;
218 }
219
227 public function setClientId($clientId)
228 {
229 $this->clientId = $clientId;
230 }
231
238 public static function canUseMultipleClients()
239 {
240 return Option::get('seo', 'use_multiple_clients', true);
241 }
242
246 public static function getTypeByEngine(string $engineCode): ?string
247 {
248 foreach (static::getTypes() as $type)
249 {
250 if($engineCode === static::getEngineCode($type))
251 {
252 return $type;
253 }
254 }
255 return null;
256 }
257
261 public static function canUseAsInternal(): bool
262 {
263 return true;
264 }
265
269 public static function getMethodPrefix(): string
270 {
271 return 'marketing';
272 }
273}
$type
Определения options.php:106
static createAudience($type, array $data)
Определения service.php:89
static getAccount($type)
Определения service.php:58
const TYPE_INSTAGRAM
Определения service.php:20
static getTypes()
Определения service.php:190
static createCampaign($type, array $data)
Определения service.php:76
static getEngineCode($type)
Определения service.php:46
static getAdSetList($type, $accountId)
Определения service.php:139
static getAudienceList($type, $accountId)
Определения service.php:126
static getTypeByEngine(string $engineCode)
Определения service.php:246
static getAds($type, $adsId)
Определения service.php:152
static getMethodPrefix()
Определения service.php:269
static canUseAsInternal()
Определения service.php:261
setClientId($clientId)
Определения service.php:227
static getCampaignList($type, $accountId)
Определения service.php:178
static getPostList($type, $params)
Определения service.php:102
static getAudience($type)
Определения service.php:114
static getInstance()
Определения service.php:28
static searchTargetingData($type, $params)
Определения service.php:165
const GROUP
Определения service.php:18
static getAuthAdapter($type)
Определения service.php:205
const TYPE_FACEBOOK
Определения service.php:19
static canUseMultipleClients()
Определения service.php:238
static create($type, $parameters=null, IService $service=null)
Определения baseapiobject.php:61
$data['IS_AVAILABLE']
Определения .description.php:13
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$instance
Определения ps_b24_final.php:14
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
Определения template.php:799
$clientId
Определения seo_client.php:18