1 <?php
2 /* --------------------------------------------------------------
3 CustomerFactory.inc.php 2015-01-29 gm
4 Gambio GmbH
5 http://www.gambio.de
6 Copyright (c) 2015 Gambio GmbH
7 Released under the GNU General Public License (Version 2)
8 [http://www.gnu.org/licenses/gpl-2.0.html]
9 --------------------------------------------------------------
10 */
11
12 MainFactory::load_class('AbstractCustomerFactory');
13
14 /**
15 * Class CustomerFactory
16 *
17 * Factory class for all needed customer data.
18 *
19 * @category System
20 * @package Customer
21 * @extends AbstractCustomerFactory
22 */
23 class CustomerFactory extends AbstractCustomerFactory
24 {
25 /**
26 * Creates a new customer object.
27 *
28 * @return Customer Created customer.
29 */
30 public function createCustomer()
31 {
32 $customer = MainFactory::create('Customer');
33
34 return $customer;
35 }
36
37
38 /**
39 * Creates a new customer address object.
40 *
41 * @return CustomerAddress Created customer address.
42 */
43 public function createCustomerAddress()
44 {
45 $address = MainFactory::create('CustomerAddress');
46
47 return $address;
48 }
49
50
51 /**
52 * Creates a new customer country object with the given parameters.
53 *
54 * @param IdType $id Country ID.
55 * @param CustomerCountryNameInterface $name Country name.
56 * @param CustomerCountryIso2Interface $iso2 Country ISO-2 code.
57 * @param CustomerCountryIso3Interface $iso3 Country ISO-3 code.
58 * @param IdType $addressFormatId Country address format ID.
59 * @param bool $status Country status.
60 *
61 * @return CustomerCountry Created customer country.
62 */
63 public function createCustomerCountry(IdType $id,
64 CustomerCountryNameInterface $name,
65 CustomerCountryIso2Interface $iso2,
66 CustomerCountryIso3Interface $iso3,
67 IdType $addressFormatId,
68 $status)
69 {
70 $country = MainFactory::create('CustomerCountry', $id, $name, $iso2, $iso3, $addressFormatId, $status);
71
72 return $country;
73 }
74
75
76 /**
77 * Creates a new customer country zone object with the given parameters.
78 *
79 * @param IdType $id Country zone ID.
80 * @param CustomerCountryZoneNameInterface $name Country zone name.
81 * @param CustomerCountryZoneIsoCodeInterface $isoCode Country ISO code.
82 *
83 * @return CustomerCountryZone Created customer country zone.
84 */
85 public function createCustomerCountryZone(IdType $id,
86 CustomerCountryZoneNameInterface $name,
87 CustomerCountryZoneIsoCodeInterface $isoCode)
88 {
89 $countryZone = MainFactory::create('CustomerCountryZone', $id, $name, $isoCode);
90
91 return $countryZone;
92 }
93
94 }