Connect AdSense over OAuth, sync entities and daily reports locally, and show placement performance in the admin panel without calling the Management API from public pages.
33 lines
838 B
PHP
33 lines
838 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Services\Adsense;
|
|
|
|
final class AdsenseSyncResult
|
|
{
|
|
/**
|
|
* @param list<string> $failedReports
|
|
*/
|
|
public function __construct(
|
|
public string $accountDisplayName = '',
|
|
public string $from = '',
|
|
public string $to = '',
|
|
public int $adUnits = 0,
|
|
public int $customChannels = 0,
|
|
public int $totalRows = 0,
|
|
public int $adUnitRows = 0,
|
|
public int $customChannelRows = 0,
|
|
public int $platformRows = 0,
|
|
public int $countryRows = 0,
|
|
public array $failedReports = [],
|
|
public bool $entitiesSynced = false,
|
|
public bool $reconnectRequired = false,
|
|
) {}
|
|
|
|
public function succeeded(): bool
|
|
{
|
|
return ! $this->reconnectRequired && $this->failedReports === [];
|
|
}
|
|
}
|