Example #1
0
 public function add($autodate = true, $null_values = false)
 {
     $this->position = Psbtmegamenu::getLastPosition((int) $this->id_parent);
     $this->level_depth = $this->calcLevelDepth();
     $context = Context::getContext();
     $id_shop = $context->shop->id;
     $res = parent::add($autodate, $null_values);
     $res &= Db::getInstance()->execute('
         INSERT INTO `' . _DB_PREFIX_ . 'psmegamenu_shop` (`id_shop`, `id_psmegamenu`)
         VALUES(' . (int) $id_shop . ', ' . (int) $this->id . ')');
     $this->cleanPositions($this->id_parent);
     return $res;
 }