1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-14 23:22:52 +01:00
invoiceninja/app/DataMapper/QuickbooksSyncMap.php
2024-09-23 16:34:13 +10:00

43 lines
980 B
PHP

<?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;
enum SyncDirection: string
{
case PUSH = 'push';
case PULL = 'pull';
case BIDIRECTIONAL = 'bidirectional';
}
/**
* QuickbooksSyncMap.
*/
class QuickbooksSyncMap
{
public bool $sync = true;
public bool $update_record = true;
public SyncDirection $direction = SyncDirection::BIDIRECTIONAL;
public function __construct(array $attributes = [])
{
$this->sync = $attributes['sync'] ?? true;
$this->update_record = $attributes['update_record'] ?? true;
$this->direction = isset($attributes['direction'])
? SyncDirection::from($attributes['direction'])
: SyncDirection::BIDIRECTIONAL;
}
}