1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
account.php
См. документацию.
1<?php
2
4
10
11abstract class Account extends Retargeting\Account
12{
13 protected const LOAD_DAILY_EXPENSES_TIMEOUT = 60;
14
23 abstract public function getExpenses($accountId, Date $dateFrom = null, Date $dateTo = null);
24
25
35 public function getExpensesReport($accountId, Date $dateFrom = null, Date $dateTo = null)
36 {
37 throw new NotImplementedException();
38 }
39
40
46 public function hasExpensesReport()
47 {
48 return false;
49 }
50
56 public function hasDailyExpensesReport(): bool
57 {
58 return false;
59 }
60
66 public function getDailyExpensesReport(?string $accountId, ?Date $dateFrom, ?Date $dateTo): Result
67 {
68 throw new NotImplementedException();
69 }
70
76 public function hasAccounts()
77 {
78 return true;
79 }
80
84 public function hasPublicPages()
85 {
86 return false;
87 }
88
95 abstract public function updateAnalyticParams($accountId, array $params, array $publicPageIds = []);
96
103 public function getPublicPages($accountId)
104 {
105 return new Result();
106 }
107
118 public function manageAdKeyword($accountId, $groupId, $id, $active = true)
119 {
120 if (!$this->hasExpensesReport())
121 {
122 throw new NotSupportedException('Not supported.');
123 }
124
125 $response = $this->getRequest()->send([
126 'methodName' => 'analytics.keyword.manage',
127 'parameters' => [
128 'accountId' => $accountId,
129 'groupId' => $groupId,
130 'id' => $id,
131 'active' => $active ? 1 : 0,
132 ]
133 ]);
134
135 return $response;
136 }
137
147 public function manageAdGroup($accountId, $id, $active = true)
148 {
149 if (!$this->hasExpensesReport())
150 {
151 throw new NotSupportedException('Not supported.');
152 }
153
154 $response = $this->getRequest()->send([
155 'methodName' => 'analytics.group.manage',
156 'parameters' => [
157 'accountId' => $accountId,
158 'id' => $id,
159 'active' => $active ? 1 : 0,
160 ]
161 ]);
162
163 return $response;
164 }
165
175 public function manageAdCampaign($accountId, $id, $active = true)
176 {
177 if (!$this->hasExpensesReport())
178 {
179 throw new NotSupportedException('Not supported.');
180 }
181
182 $response = $this->getRequest()->send([
183 'methodName' => 'analytics.campaign.manage',
184 'parameters' => [
185 'accountId' => $accountId,
186 'id' => $id,
187 'active' => $active ? 1 : 0,
188 ]
189 ]);
190
191 return $response;
192 }
193
194 protected function buildErrorMessage(string $error): string
195 {
196 $accountType = static::TYPE_CODE;
197 return "[{$accountType} account error] {$error}";
198 }
199}
Определения date.php:9
updateAnalyticParams($accountId, array $params, array $publicPageIds=[])
getDailyExpensesReport(?string $accountId, ?Date $dateFrom, ?Date $dateTo)
Определения account.php:66
buildErrorMessage(string $error)
Определения account.php:194
const LOAD_DAILY_EXPENSES_TIMEOUT
Определения account.php:13
hasAccounts()
Определения account.php:76
hasDailyExpensesReport()
Определения account.php:56
getPublicPages($accountId)
Определения account.php:103
hasExpensesReport()
Определения account.php:46
getExpensesReport($accountId, Date $dateFrom=null, Date $dateTo=null)
Определения account.php:35
hasPublicPages()
Определения account.php:84
manageAdGroup($accountId, $id, $active=true)
Определения account.php:147
manageAdCampaign($accountId, $id, $active=true)
Определения account.php:175
manageAdKeyword($accountId, $groupId, $id, $active=true)
Определения account.php:118
getExpenses($accountId, Date $dateFrom=null, Date $dateTo=null)
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
Определения account.php:3
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
Определения template.php:799
$response
Определения result.php:21
$error
Определения subscription_card_product.php:20