Passed
Push — master ( 4353de...fd9b87 )
by Aimeos
17:01 queued 14:25
created

Laravel   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 11
c 1
b 0
f 0
dl 0
loc 41
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getSearchAttributes() 0 9 1
A getConfigPath() 0 3 1
A table() 0 3 1
1
<?php
2
3
/**
4
 * @license LGPLv3, http://opensource.org/licenses/LGPL-3.0
5
 * @copyright Aimeos (aimeos.org), 2015-2024
6
 * @package MShop
7
 * @subpackage Customer
8
 */
9
10
11
namespace Aimeos\MShop\Customer\Manager\Address;
12
13
14
/**
15
 * Laravel implementation of the customer address class.
16
 *
17
 * @package MShop
18
 * @subpackage Customer
19
 */
20
class Laravel
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 "users_address" AS mcusad ON ( mcus."id" = mcusad."parentid" )'],
36
				'type' => 'int',
37
				'public' => false,
38
			]
39
		] ) );
40
	}
41
42
43
	/**
44
	 * Returns the config path for retrieving the configuration values.
45
	 *
46
	 * @return string Configuration path
47
	 */
48
	protected function getConfigPath() : string
49
	{
50
		return 'mshop/customer/manager/address/laravel/';
51
	}
52
53
	/**
54
	 * Returns the name of the used table
55
	 *
56
	 * @return string Table name
57
	 */
58
	protected function table() : string
59
	{
60
		return 'users_address';
61
	}
62
}
63