Completed
Push — master ( b07e17...b65747 )
by Aimeos
01:54
created

Typo3::getSearchConfig()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
/**
4
 * @license LGPLv3, http://opensource.org/licenses/LGPL-3.0
5
 * @copyright Metaways Infosystems GmbH, 2013
6
 * @copyright Aimeos (aimeos.org), 2014-2016
7
 * @package MShop
8
 * @subpackage Customer
9
 */
10
11
12
namespace Aimeos\MShop\Customer\Manager\Address;
13
14
15
/**
16
 * TYPO3 implementation of the customer address class.
17
 *
18
 * @package MShop
19
 * @subpackage Customer
20
 */
21
class Typo3
22
	extends \Aimeos\MShop\Customer\Manager\Address\Standard
23
	implements \Aimeos\MShop\Customer\Manager\Address\Iface
24
{
25
	private $searchConfig = array(
0 ignored issues
show
Comprehensibility introduced by
Consider using a different property name as you override a private property of the parent class.
Loading history...
26
		'customer.address.id' => array(
27
			'label' => 'Customer address ID',
28
			'code' => 'customer.address.id',
29
			'internalcode' => 't3feuad."id"',
30
			'internaldeps' => array( 'LEFT JOIN "fe_users_address" AS t3feuad ON ( t3feu."uid" = t3feuad."parentid" )' ),
31
			'type' => 'integer',
32
			'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_INT,
33
			'public' => false,
34
		),
35
		// customer.siteid is only for informational purpuse, not for filtering
36
		'customer.address.parentid' => array(
37
			'label' => 'Customer address parent ID',
38
			'code' => 'customer.address.parentid',
39
			'internalcode' => 't3feuad."parentid"',
40
			'type' => 'integer',
41
			'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_STR,
42
			'public' => false,
43
		),
44
		'customer.address.company'=> array(
45
			'label' => 'Customer address company',
46
			'code' => 'customer.address.company',
47
			'internalcode' => 't3feuad."company"',
48
			'type' => 'string',
49
			'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_STR,
50
		),
51
		'customer.address.vatid'=> array(
52
			'label' => 'Customer address VAT ID',
53
			'code' => 'customer.address.vatid',
54
			'internalcode' => 't3feuad."vatid"',
55
			'type' => 'string',
56
			'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_STR,
57
		),
58
		'customer.address.salutation' => array(
59
			'label' => 'Customer address salutation',
60
			'code' => 'customer.address.salutation',
61
			'internalcode' => 't3feuad."salutation"',
62
			'type' => 'integer',
63
			'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_STR,
64
		),
65
		'customer.address.title' => array(
66
			'label' => 'Customer address title',
67
			'code' => 'customer.address.title',
68
			'internalcode' => 't3feuad."title"',
69
			'type' => 'string',
70
			'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_STR,
71
		),
72
		'customer.address.firstname' => array(
73
			'label' => 'Customer address firstname',
74
			'code' => 'customer.address.firstname',
75
			'internalcode' => 't3feuad."firstname"',
76
			'type' => 'string',
77
			'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_STR,
78
		),
79
		'customer.address.lastname' => array(
80
			'label' => 'Customer address lastname',
81
			'code' => 'customer.address.lastname',
82
			'internalcode' => 't3feuad."lastname"',
83
			'type' => 'string',
84
			'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_STR,
85
		),
86
		'customer.address.address1' => array(
87
			'label' => 'Customer address address part one',
88
			'code' => 'customer.address.address1',
89
			'internalcode' => 't3feuad."address1"',
90
			'type' => 'string',
91
			'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_STR,
92
		),
93
		'customer.address.address2' => array(
94
			'label' => 'Customer address address part two',
95
			'code' => 'customer.address.address2',
96
			'internalcode' => 't3feuad."address2"',
97
			'type' => 'string',
98
			'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_STR,
99
		),
100
		'customer.address.address3' => array(
101
			'label' => 'Customer address address part three',
102
			'code' => 'customer.address.address3',
103
			'internalcode' => 't3feuad."address3"',
104
			'type' => 'string',
105
			'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_STR,
106
		),
107
		'customer.address.postal' => array(
108
			'label' => 'Customer address postal',
109
			'code' => 'customer.address.postal',
110
			'internalcode' => 't3feuad."postal"',
111
			'type' => 'string',
112
			'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_STR,
113
		),
114
		'customer.address.city' => array(
115
			'label' => 'Customer address city',
116
			'code' => 'customer.address.city',
117
			'internalcode' => 't3feuad."city"',
118
			'type' => 'string',
119
			'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_STR,
120
		),
121
		'customer.address.state' => array(
122
			'label' => 'Customer address state',
123
			'code' => 'customer.address.state',
124
			'internalcode' => 't3feuad."state"',
125
			'type' => 'string',
126
			'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_STR,
127
		),
128
		'customer.address.languageid' => array(
129
			'label' => 'Customer address language',
130
			'code' => 'customer.address.languageid',
131
			'internalcode' => 't3feuad."langid"',
132
			'type' => 'string',
133
			'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_STR,
134
		),
135
		'customer.address.countryid' => array(
136
			'label' => 'Customer address country',
137
			'code' => 'customer.address.countryid',
138
			'internalcode' => 't3feuad."countryid"',
139
			'type' => 'string',
140
			'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_STR,
141
		),
142
		'customer.address.telephone' => array(
143
			'label' => 'Customer address telephone',
144
			'code' => 'customer.address.telephone',
145
			'internalcode' => 't3feuad."telephone"',
146
			'type' => 'string',
147
			'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_STR,
148
		),
149
		'customer.address.email' => array(
150
			'label' => 'Customer address email',
151
			'code' => 'customer.address.email',
152
			'internalcode' => 't3feuad."email"',
153
			'type' => 'string',
154
			'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_STR,
155
		),
156
		'customer.address.telefax' => array(
157
			'label' => 'Customer address telefax',
158
			'code' => 'customer.address.telefax',
159
			'internalcode' => 't3feuad."telefax"',
160
			'type' => 'string',
161
			'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_STR,
162
		),
163
		'customer.address.website' => array(
164
			'label' => 'Customer address website',
165
			'code' => 'customer.address.website',
166
			'internalcode' => 't3feuad."website"',
167
			'type' => 'string',
168
			'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_STR,
169
		),
170
		'customer.address.longitude' => array(
171
			'label' => 'Customer address longitude',
172
			'code' => 'customer.address.longitude',
173
			'internalcode' => 't3feuad."longitude"',
174
			'type' => 'string',
175
			'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_STR,
176
		),
177
		'customer.address.latitude' => array(
178
			'label' => 'Customer address latitude',
179
			'code' => 'customer.address.latitude',
180
			'internalcode' => 't3feuad."latitude"',
181
			'type' => 'string',
182
			'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_STR,
183
		),
184
		'customer.address.flag' => array(
185
			'label' => 'Customer address flag',
186
			'code' => 'customer.address.flag',
187
			'internalcode' => 't3feuad."flag"',
188
			'type' => 'integer',
189
			'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_INT,
190
		),
191
		'customer.address.position' => array(
192
			'code' => 'customer.address.position',
193
			'internalcode' => 't3feuad."pos"',
194
			'label' => 'Customer address position',
195
			'type' => 'integer',
196
			'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_INT,
197
		),
198
		'customer.address.ctime'=> array(
199
			'code'=>'customer.address.ctime',
200
			'internalcode'=>'t3feuad."ctime"',
201
			'label'=>'Customer address create date/time',
202
			'type'=> 'datetime',
203
			'internaltype'=> \Aimeos\MW\DB\Statement\Base::PARAM_STR,
204
		),
205
		'customer.address.mtime'=> array(
206
			'code'=>'customer.address.mtime',
207
			'internalcode'=>'t3feuad."mtime"',
208
			'label'=>'Customer address modification date/time',
209
			'type'=> 'datetime',
210
			'internaltype'=> \Aimeos\MW\DB\Statement\Base::PARAM_STR,
211
		),
212
		'customer.address.editor'=> array(
213
			'code'=>'customer.address.editor',
214
			'internalcode'=>'t3feuad."editor"',
215
			'label'=>'Customer address editor',
216
			'type'=> 'string',
217
			'internaltype'=> \Aimeos\MW\DB\Statement\Base::PARAM_STR,
218
		),
219
	);
220
221
222
	/**
223
	 * Removes old entries from the storage.
224
	 *
225
	 * @param array $siteids List of IDs for sites whose entries should be deleted
226
	 */
227
	public function cleanup( array $siteids )
228
	{
229
		$path = 'mshop/customer/manager/address/submanagers';
230
		foreach( $this->getContext()->getConfig()->get( $path, [] ) as $domain ) {
231
			$this->getObject()->getSubManager( $domain )->cleanup( $siteids );
232
		}
233
	}
234
235
236
	/**
237
	 * Removes multiple items specified by ids in the array.
238
	 *
239
	 * @param array $ids List of IDs
240
	 */
241
	public function deleteItems( array $ids )
242
	{
243
		$path = 'mshop/customer/manager/address/typo3/delete';
244
		$this->deleteItemsBase( $ids, $path, false );
245
	}
246
247
248
	/**
249
	 * Returns the list attributes that can be used for searching.
250
	 *
251
	 * @param boolean $withsub Return also attributes of sub-managers if true
252
	 * @return array List of attribute items implementing \Aimeos\MW\Criteria\Attribute\Iface
253
	 */
254
	public function getSearchAttributes( $withsub = true )
255
	{
256
		$path = 'mshop/customer/manager/address/submanagers';
257
258
		return $this->getSearchAttributesBase( $this->searchConfig, $path, [], $withsub );
259
	}
260
261
262
	/**
263
	 * Returns a new manager for customer extensions
264
	 *
265
	 * @param string $manager Name of the sub manager type in lower case
266
	 * @param string|null $name Name of the implementation, will be from configuration (or Default) if null
267
	 * @return mixed Manager for different extensions, e.g stock, tags, locations, etc.
268
	 */
269
	public function getSubManager( $manager, $name = null )
270
	{
271
		return $this->getSubManagerBase( 'customer', 'address/' . $manager, ( $name === null ? 'Typo3' : $name ) );
272
	}
273
274
275
	/**
276
	 * Returns the config path for retrieving the configuration values.
277
	 *
278
	 * @return string Configuration path (mshop/customer/manager/address/typo3/item/)
279
	 */
280
	protected function getConfigPath()
281
	{
282
		return 'mshop/customer/manager/address/typo3/';
283
	}
284
285
286
	/**
287
	 * Returns the search configuration for searching items.
288
	 *
289
	 * @return array Associative list of search keys and search definitions
290
	 */
291
	protected function getSearchConfig()
292
	{
293
		return $this->searchConfig;
294
	}
295
}
296