public function registerVendor data Mage log enter null shq log Mage l

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
public function registerVendor($data)
{
Mage::log('enter', null, 'shq.log');
Mage::log($data, null, 'shq.log');
if ($data['shop_id'] == null ||$data['shop_state'] == null || $data['shop_name'] == null) {
return -2;
}
try {
Mage::log('start', null, 'shq.log');
$vendor = Mage::getModel("vaimo_mirakl/vendor");
$vendor->setShopName($data['shop_name'])
->setShopState($data['shop_state'])
->setShopId($data['shop_id']);
if(isset($data['shop_url'])) {
$vendor->setUrlKey($data['shop_url']);
}
if(isset($data['shop_detail'])) {
$vendor ->setContactInformations($data['shop_detail']);
}
if(isset($data['shop_banner'])) {
$vendor ->setBanner($data['shop_banner']);
}
if(isset($data['shop_logo'])) {
$vendor ->setLogo($data['shop_logo']);
}
$vendor->save();
Mage::log('close', null, 'shq.log');
return 1;
} catch (Exception $e) {
Mage::log("\n" . $e->__toString(), Zend_Log::ERR, 'shq.log');
return 0;
}
}