AccountingContact::addPhone()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
namespace MacsiDigital\Xero;
4
5
use MacsiDigital\Xero\Support\Model;
6
7
class AccountingContact extends Model
8
{
9
    const ENDPOINT = 'Contacts';
10
    const NODE_NAME = 'Contact';
11
    const KEY_FIELD = 'ContactID';
12
13
    protected $methods = ['get', 'post', 'put'];
14
15
    protected $attributes = [
16
        'ContactID' => '',
17
        'ContactNumber' => '',
18
        'AccountNumber' => '',
19
        'ContactStatus' => 'ACTIVE',
20
        'Name' => '',
21
        'FirstName' => '',
22
        'LastName' => '',
23
        'EmailAddress' => '',
24
        'SkypeUserName' => '',
25
        'ContactPersons' => [],
26
        'BankAccountDetails' => '',
27
        'TaxNumber' => '',
28
        'AccountsReceivableTaxType' => '',
29
        'AccountsPayableTaxType' => '',
30
        'Addresses' => [],
31
        'Phones' => [],
32
        'IsSupplier' => '',
33
        'IsCustomer' => '',
34
        'DefaultCurrency' => '',
35
        'XeroNetworkKey' => '',
36
        'SalesDefaultAccountCode' => '',
37
        'PurchasesDefaultAccountCode' => '',
38
        'SalesTrackingCategories' => '',
39
        'PurchasesTrackingCategories' => '',
40
        'TrackingCategoryName' => '',
41
        'TrackingCategoryOption' => '',
42
        'PaymentTerms' => '',
43
        'UpdatedDateUTC' => '',
44
        'ContactGroups' => '',
45
        'Website' => '',
46
        'BrandingTheme' => '',
47
        'BatchPayments' => '',
48
        'Discount' => '',
49
        'Balances' => '',
50
        'HasAttachments' => '',
51
    ];
52
53
    protected $relationships = [
54
        'Addresses' => '\MacsiDigital\Xero\AccountingAddress',
55
        'Phones' => '\MacsiDigital\Xero\AccountingPhone',
56
        'ContactPersons' => '\MacsiDigital\Xero\AccountingContactPerson',
57
    ];
58
59
    protected $queryAttributes = [
60
      'Name',
61
      'EmailAddress',
62
    ];
63
64
    public function addAddress($item)
65
    {
66
        $this->attributes['Addresses'][] = $item;
67
    }
68
69
    public function addPhone($item)
70
    {
71
        $this->attributes['Phones'][] = $item;
72
    }
73
}
74