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