1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-15 07:33:04 +01:00
invoiceninja/app/DataMapper/QuickbooksSettings.php

58 lines
1.5 KiB
PHP
Raw Normal View History

2024-08-26 00:24:51 +02:00
<?php
/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/
namespace App\DataMapper;
2024-08-26 01:49:22 +02:00
use Illuminate\Contracts\Database\Eloquent\Castable;
use App\Casts\QuickbooksSettingsCast;
2024-08-26 00:24:51 +02:00
/**
* QuickbooksSettings.
*/
2024-08-26 01:49:22 +02:00
class QuickbooksSettings implements Castable
2024-08-26 00:24:51 +02:00
{
public string $accessTokenKey;
public string $refresh_token;
public string $realmID;
public int $accessTokenExpiresAt;
public int $refreshTokenExpiresAt;
2024-08-27 06:47:18 +02:00
public string $baseURL;
2024-09-22 23:16:34 +02:00
public QuickbooksSync $settings;
public function __construct(array $attributes = [])
{
$this->accessTokenKey = $attributes['accessTokenKey'] ?? '';
$this->refresh_token = $attributes['refresh_token'] ?? '';
$this->realmID = $attributes['realmID'] ?? '';
$this->accessTokenExpiresAt = $attributes['accessTokenExpiresAt'] ?? 0;
$this->refreshTokenExpiresAt = $attributes['refreshTokenExpiresAt'] ?? 0;
$this->baseURL = $attributes['baseURL'] ?? '';
2024-09-22 23:55:53 +02:00
$this->settings = new QuickbooksSync($attributes['settings'] ?? []);
2024-09-22 23:16:34 +02:00
}
2024-08-26 01:49:22 +02:00
public static function castUsing(array $arguments): string
{
return QuickbooksSettingsCast::class;
}
2024-09-22 23:16:34 +02:00
public static function fromArray(array $data): self
{
return new self($data);
}
2024-08-26 00:24:51 +02:00
}