|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace N98\Magento\Command\Customer; |
|
4
|
|
|
|
|
5
|
|
|
use Mage_Customer_Model_Address; |
|
6
|
|
|
use Mage_Customer_Model_Customer; |
|
7
|
|
|
use Mage_Customer_Model_Resource_Customer_Collection; |
|
8
|
|
|
use Mage_Directory_Model_Resource_Country_Collection; |
|
9
|
|
|
use Mage_Directory_Model_Resource_Region_Collection; |
|
10
|
|
|
use N98\Magento\Command\AbstractMagentoCommand; |
|
11
|
|
|
use N98\Util\Exec; |
|
12
|
|
|
|
|
13
|
|
|
/** |
|
14
|
|
|
* Class AbstractCustomerCommand |
|
15
|
|
|
* |
|
16
|
|
|
* @package N98\Magento\Command\Customer |
|
17
|
|
|
*/ |
|
18
|
|
|
abstract class AbstractCustomerCommand extends AbstractMagentoCommand |
|
19
|
|
|
{ |
|
20
|
|
|
/** |
|
21
|
|
|
* @return Mage_Customer_Model_Customer |
|
22
|
|
|
*/ |
|
23
|
|
|
protected function getCustomerModel() |
|
24
|
|
|
{ |
|
25
|
|
|
return $this->_getModel('customer/customer', 'Mage_Customer_Model_Customer'); |
|
26
|
|
|
} |
|
27
|
|
|
|
|
28
|
|
|
/** |
|
29
|
|
|
* @return Mage_Customer_Model_Resource_Customer_Collection |
|
30
|
|
|
*/ |
|
31
|
|
|
protected function getCustomerCollection() |
|
32
|
|
|
{ |
|
33
|
|
|
return $this->_getResourceModel('customer/customer_collection', 'Mage_Customer_Model_Resource_Customer_Collection'); |
|
|
|
|
|
|
34
|
|
|
} |
|
35
|
|
|
|
|
36
|
|
|
/** |
|
37
|
|
|
* @return Mage_Customer_Model_Address |
|
38
|
|
|
*/ |
|
39
|
|
|
protected function getAddressModel() |
|
40
|
|
|
{ |
|
41
|
|
|
return $this->_getModel('customer/address', 'Mage_Customer_Model_Address'); |
|
42
|
|
|
} |
|
43
|
|
|
|
|
44
|
|
|
/** |
|
45
|
|
|
* @return Mage_Directory_Model_Resource_Region_Collection |
|
46
|
|
|
*/ |
|
47
|
|
|
protected function getRegionCollection() |
|
48
|
|
|
{ |
|
49
|
|
|
return $this->_getResourceModel('directory/region_collection', 'Mage_Directory_Model_Resource_Region_Collection'); |
|
|
|
|
|
|
50
|
|
|
} |
|
51
|
|
|
|
|
52
|
|
|
/** |
|
53
|
|
|
* @return Mage_Directory_Model_Resource_Country_Collection |
|
54
|
|
|
*/ |
|
55
|
|
|
protected function getCountryCollection() |
|
56
|
|
|
{ |
|
57
|
|
|
return $this->_getResourceModel('directory/country_collection', 'Mage_Directory_Model_Resource_Country_Collection'); |
|
|
|
|
|
|
58
|
|
|
} |
|
59
|
|
|
} |
|
60
|
|
|
|
Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.