-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathSchema.php
198 lines (181 loc) · 6.68 KB
/
Schema.php
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
<?php
namespace KingPalm\B2B;
// 2019-06-04
final class Schema {
/**
* 2019-06-11
* @used-by \KingPalm\B2B\Block\Registration::_toHtml()
* @used-by \KingPalm\B2B\Setup\UpgradeData::_process()
* @used-by \KingPalm\B2B\Setup\UpgradeSchema::_process()
* @param bool $l [optional]
* @return string
*/
static function address($l = false) {return !$l ? 'street[]' : 'Storefront Business Address';}
/**
* 2019-06-15
* "Implement the «Sales Agent» field for the «Customer» entity":
* https://github.com/kingpalm-com/b2b/issues/2
* @used-by \KingPalm\B2B\Block\Registration::_toHtml()
* @used-by \KingPalm\B2B\Observer\RegisterSuccess::execute()
* @used-by \KingPalm\B2B\Setup\UpgradeData::_process()
* @used-by \KingPalm\B2B\Setup\UpgradeSchema::_process()
* @param bool $l [optional]
* @return string
*/
static function agent($l = false) {return !$l ? self::f() : 'Sales Agent';}
/**
* 2019-06-11
* @used-by \KingPalm\B2B\Block\Registration::_toHtml()
* @used-by \KingPalm\B2B\Setup\UpgradeData::_process()
* @used-by \KingPalm\B2B\Setup\UpgradeSchema::_process()
* @param bool $l [optional]
* @return string
*/
static function city($l = false) {return !$l ? 'city' : 'City';}
/**
* 2019-06-11
* @used-by \KingPalm\B2B\Block\RegionJS\Backend::_toHtml()
* @used-by \KingPalm\B2B\Block\RegionJS\Frontend::_toHtml()
* @used-by \KingPalm\B2B\Block\Registration::_toHtml()
* @used-by \KingPalm\B2B\Setup\UpgradeData::_process()
* @used-by \KingPalm\B2B\Setup\UpgradeSchema::_process()
* @param bool $l [optional]
* @return string
*/
static function country($l = false) {return !$l ? 'country_id' : 'Country';}
/**
* 2019-06-10
* @used-by \KingPalm\B2B\Block\Registration::_toHtml()
* @used-by \KingPalm\B2B\Observer\RegisterSuccess::execute()
* @used-by \KingPalm\B2B\Setup\UpgradeData::_process()
* @used-by \KingPalm\B2B\Setup\UpgradeSchema::_process()
* @param bool $l [optional]
* @return string
*/
static function dba($l = false) {return !$l ? self::f() : 'DBA (Doing Business As)';}
/**
* 2019-06-04
* @used-by \KingPalm\B2B\Block\RegionJS\Backend::_toHtml()
* @used-by \KingPalm\B2B\Block\Registration::_toHtml()
* @used-by \KingPalm\B2B\Observer\RegisterSuccess::execute()
* @used-by \KingPalm\B2B\Setup\UpgradeData::_process()
* @used-by \KingPalm\B2B\Setup\UpgradeSchema::_process()
* @used-by \KingPalm\B2B\Setup\V140\MoveDataToAddress::p()
* @param bool $l [optional]
* @return string
*/
static function enable($l = false) {return !$l ? self::f() : 'Retail Registration?';}
/**
* 2019-06-21 Currently, it is not used.
* @param string $f
* @return bool
*/
static function isCustom($f) {return df_starts_with($f, self::$PREFIX);}
/**
* 2019-06-04
* @used-by \KingPalm\B2B\Block\Registration::_toHtml()
* @used-by \KingPalm\B2B\Observer\RegisterSuccess::execute()
* @used-by \KingPalm\B2B\Setup\UpgradeData::_process()
* @used-by \KingPalm\B2B\Setup\UpgradeSchema::_process()
* @param bool $l [optional]
* @return string
*/
static function name($l = false) {return !$l ? 'company' : 'Business Name';}
/**
* 2019-06-11
* @used-by \KingPalm\B2B\Block\Registration::_toHtml()
* @used-by \KingPalm\B2B\Observer\RegisterSuccess::execute()
* @used-by \KingPalm\B2B\Setup\UpgradeData::_process()
* @used-by \KingPalm\B2B\Setup\UpgradeSchema::_process()
* @param bool $l [optional]
* @return string
*/
static function notes($l = false) {return !$l ? self::f() : 'Notes';}
/**
* 2019-06-11
* @used-by \KingPalm\B2B\Block\Registration::_toHtml()
* @used-by \KingPalm\B2B\Observer\RegisterSuccess::execute()
* @used-by \KingPalm\B2B\Setup\UpgradeData::_process()
* @used-by \KingPalm\B2B\Setup\UpgradeSchema::_process()
* @param bool $l [optional]
* @return string
*/
static function number_of_locations($l = false) {return !$l ? self::f() : 'Number of Locations';}
/**
* 2019-06-11
* @used-by \KingPalm\B2B\Block\Registration::_toHtml()
* @used-by \KingPalm\B2B\Setup\UpgradeData::_process()
* @used-by \KingPalm\B2B\Setup\UpgradeSchema::_process()
* @param bool $l [optional]
* @return string
*/
static function phone($l = false) {return !$l ? 'telephone' : 'Phone Number';}
/**
* 2019-06-11
* @used-by \KingPalm\B2B\Block\RegionJS\Backend::_toHtml()
* @used-by \KingPalm\B2B\Block\RegionJS\Frontend::_toHtml()
* @used-by \KingPalm\B2B\Block\Registration::_toHtml()
* @used-by \KingPalm\B2B\Setup\UpgradeData::_process()
* @used-by \KingPalm\B2B\Setup\UpgradeSchema::_process()
* @param bool $l [optional]
* @return string
*/
static function postcode($l = false) {return !$l ? 'postcode' : 'Zip Code';}
/**
* 2019-06-11
* @used-by \KingPalm\B2B\Block\RegionJS\Backend::_toHtml()
* @used-by \KingPalm\B2B\Block\RegionJS\Frontend::_toHtml()
* @used-by \KingPalm\B2B\Block\Registration::region()
* @used-by \KingPalm\B2B\Setup\UpgradeData::_process()
* @used-by \KingPalm\B2B\Setup\UpgradeSchema::_process()
* @param bool $l [optional]
* @return string
*/
static function region($l = false) {return !$l ? 'region' : 'State/Province';}
/**
* 2019-06-11
* @used-by \KingPalm\B2B\Block\RegionJS\Backend::_toHtml()
* @used-by \KingPalm\B2B\Block\RegionJS\Frontend::_toHtml()
* @used-by \KingPalm\B2B\Block\Registration::region()
* @used-by \KingPalm\B2B\Setup\UpgradeData::_process()
* @used-by \KingPalm\B2B\Setup\UpgradeSchema::_process()
* @param bool $l [optional]
* @return string
*/
static function region_id($l = false) {return !$l ? 'region_id' : 'State/Province';}
/**
* 2019-06-11
* @used-by \KingPalm\B2B\Block\Registration::_toHtml()
* @used-by \KingPalm\B2B\Setup\UpgradeData::_process()
* @used-by \KingPalm\B2B\Setup\UpgradeSchema::_process()
* @param bool $l [optional]
* @return string
*/
static function tax($l = false) {return !$l ? 'vat_id' : 'Tax ID';}
/**
* 2019-06-10
* @used-by \KingPalm\B2B\Block\Registration::_toHtml()
* @used-by \KingPalm\B2B\Observer\RegisterSuccess::execute()
* @used-by \KingPalm\B2B\Setup\UpgradeData::_process()
* @used-by \KingPalm\B2B\Setup\UpgradeSchema::_process()
* @param bool $l [optional]
* @return string
*/
static function type($l = false) {return !$l ? self::f() : 'What type of business do you run?';}
/**
* 2019-06-04
* @used-by dba()
* @used-by enable()
* @used-by number_of_locations()
* @used-by type()
* @return string
*/
private static function f() {return self::$PREFIX . df_caller_f();}
/**
* 2019-06-21
* @used-by f()
* @used-by isCustom()
* @var string
*/
private static $PREFIX = 'kingpalm_b2b_';
}