FosUser::getSearchAttributes()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 7
nc 1
nop 1
dl 0
loc 9
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * @license LGPLv3, http://opensource.org/licenses/LGPL-3.0
5
 * @copyright Aimeos (aimeos.org), 2015-2025
6
 * @package MShop
7
 * @subpackage Customer
8
 */
9
10
11
namespace Aimeos\MShop\Customer\Manager\Address;
12
13
14
/**
15
 * Fos user bundle implementation of the customer address class.
16
 *
17
 * @package MShop
18
 * @subpackage Customer
19
 */
20
class FosUser
21
	extends \Aimeos\MShop\Customer\Manager\Address\Standard
22
{
23
	/**
24
	 * Returns the attributes that can be used for searching.
25
	 *
26
	 * @param bool $withsub Return also attributes of sub-managers if true
27
	 * @return \Aimeos\Base\Criteria\Attribute\Iface[] List of search attribute items
28
	 */
29
	public function getSearchAttributes( bool $withsub = true ) : array
30
	{
31
		return array_replace( parent::getSearchAttributes( $withsub ), $this->createAttributes( [
32
			'customer.address.id' => [
33
				'label' => 'Customer address ID',
34
				'internalcode' => 'id',
35
				'internaldeps' => ['LEFT JOIN "fos_user_address" AS mcusad ON ( mcus."id" = mcusad."parentid" )'],
36
				'type' => 'int',
37
				'public' => false,
38
			]
39
		] ) );
40
	}
41
42
43
	/**
44
	 * Returns the name of the used table
45
	 *
46
	 * @return string Table name
47
	 */
48
	protected function table() : string
49
	{
50
		return 'fos_user_address';
51
	}
52
}
53