Jake Vanderwerf
9 days ago ed57c386db34d8693ca75311972d0929ebe5f488
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?php
namespace JVBase\managers\SEO\render\Traits\_Properties;
 
use JVBase\managers\SEO\render\Thing\Intangible\ContactPoint\PostalAddress;
 
if (!defined('ABSPATH')) {
    exit;
}
trait legalAddressTrait {
    /**
     * @var PostalAddress The legal address of an organization which acts as the officially registered address used for legal and tax purposes. The legal address can be different from the place of operations of a business and other addresses can be part of an organization.
     */
    protected PostalAddress $legalAddress;
 
    public function getLegalAddress():?PostalAddress
    {
        return $this->legalAddress??null;
    }
    public function setLegalAddress(PostalAddress $legalAddress):void
    {
        $this->legalAddress = $legalAddress;
    }
 
    public function getLegalAddressFieldConfig():array
    {
        return [
            'type'  => 'group',
            'label' => 'Address',
            'wrap'  => 'details',
            'fields'    => [
                'streetAddress' => [
                    'type' => 'text',
                    'label'=> 'Street Address',
                    'hint'  => 'The street address. For example, "6551 111 St NW"'
                ],
                'extendedAddress'   => [
                    'type' => 'text',
                    'label'=> 'Extended Address',
                    'hint'  => 'An address extension such as an apartment number, C/O or alternative name.'
                ],
                'postOfficeBoxNumber'   => [
                    'type' => 'text',
                    'label' => 'PO Box Number',
                ],
                'addressLocality'   => [
                    'type'  => 'text',
                    'label' => 'Address Locality',
                    'hint'  => 'The locality in which the street address is, and which is in the region. For example, "Park Allen".'
                ],
                'addressRegion' => [
                    'type'  => 'text',
                    'label' => 'Address Region (Province)',
                ],
                'postalCode'    => [
                    'type'  => 'text',
                    'label' => 'Postal Code',
                    'hint'  => 'The postal code. For example, T6H 4R5.'
                ],
                'addressCountry'    => [
                    'type'  => 'text',
                    'label' => 'Country',
                    'hint'  => 'The address country. For example, "CA".',
                    'default' => 'CA'
                ]
            ]
        ];
    }
}