OXID eShop CE  4.10.1
 All Classes Namespaces Files Functions Variables Pages
shop_default_category_ajax.php
Go to the documentation of this file.
1 <?php
2 
7 {
8 
14  protected $_aColumns = array('container1' => array( // field , table, visible, multilanguage, ident
15  array('oxtitle', 'oxcategories', 1, 1, 0),
16  array('oxdesc', 'oxcategories', 1, 1, 0),
17  array('oxid', 'oxcategories', 0, 0, 0),
18  array('oxid', 'oxcategories', 0, 0, 1)
19  )
20  );
21 
27  protected function _getQuery()
28  {
29  $oCat = oxNew('oxcategory');
30  $oCat->setLanguage(oxRegistry::getConfig()->getRequestParameter('editlanguage'));
31 
32  $sCategoriesTable = $oCat->getViewName();
33 
34  return " from $sCategoriesTable where " . $oCat->getSqlActiveSnippet();
35  }
36 
40  public function unassignCat()
41  {
42  $sShopId = oxRegistry::getConfig()->getRequestParameter('oxid');
43  $oShop = oxNew('oxshop');
44  if ($oShop->load($sShopId)) {
45  $oShop->oxshops__oxdefcat = new oxField('');
46  $oShop->save();
47  }
48  }
49 
53  public function assignCat()
54  {
55  $sChosenCat = oxRegistry::getConfig()->getRequestParameter('oxcatid');
56  $sShopId = oxRegistry::getConfig()->getRequestParameter('oxid');
57  $oShop = oxNew('oxshop');
58  if ($oShop->load($sShopId)) {
59  $oShop->oxshops__oxdefcat = new oxField($sChosenCat);
60  $oShop->save();
61  }
62  }
63 }