Ejemplo n.º 1
0
 public function removeConcert($id)
 {
     $this->db->begin();
     try {
         $this->db->query("DELETE FROM concert WHERE id=%i", $id);
         $this->nameModel->clear('concert', array('name_id', 'place_name_id', 'text_name_id'));
     } catch (Exception $ex) {
         $this->db->rollback();
         throw $ex;
     }
     $this->db->commit();
     return $this;
 }
Ejemplo n.º 2
0
 public function setMenu(array $items)
 {
     $this->db->begin();
     try {
         $this->saveMenu($items, 0);
         $this->nameModel->clear('menu');
     } catch (Exception $ex) {
         $this->db->rollback();
         throw $ex;
     }
     $this->db->commit();
     return $this;
 }
Ejemplo n.º 3
0
 public function setPage($menuId, $text)
 {
     $this->db->begin();
     try {
         $nameId = $this->nameModel->setName($text, 'page', FALSE);
         $this->db->query("INSERT INTO [page] (menu_id, name_id) VALUES (%i, %i) ON DUPLICATE KEY UPDATE name_id=%i", $menuId, $nameId, $nameId);
         $this->nameModel->clear('page');
     } catch (Exception $ex) {
         $this->db->rollback();
         throw $ex;
     }
     $this->db->commit();
     return $this;
 }
Ejemplo n.º 4
0
 public function setArticle($menuId, $text, $id = NULL)
 {
     $this->db->begin();
     try {
         $nameId = $this->nameModel->setName($text, 'article', FALSE);
         if ($id) {
             $this->db->query("UPDATE [article] SET name_id=%i WHERE id=%i", $nameId, $id);
         } else {
             $this->db->query("INSERT INTO [article] (menu_id, name_id) VALUES (%i, %i)", $menuId, $nameId);
             $id = $this->db->getInsertId();
         }
         $this->setArticleUrl($text, $menuId, $id, $nameId);
         $this->moveArticleUp($menuId);
         $this->nameModel->clear('article');
     } catch (Exception $ex) {
         $this->db->rollback();
         throw $ex;
     }
     $this->db->commit();
     return $id;
 }
Ejemplo n.º 5
0
 public function remove($id, $type)
 {
     $this->db->begin();
     try {
         $this->db->query("DELETE FROM %sql WHERE id=%i", $type, $id);
         $this->nameModel->clear($type);
     } catch (Exception $ex) {
         $this->db->rollback();
         throw $ex;
     }
     $this->db->commit();
     return $this;
 }
Ejemplo n.º 6
0
 public function removeAlbum($id)
 {
     $this->db->begin();
     try {
         $this->db->query("DELETE FROM song WHERE album_id=%i", $id);
         $this->db->query("DELETE FROM album WHERE id=%i", $id);
         $this->nameModel->clear('album', array('name_id', 'text_name_id'))->clear('song', array('name_id', 'text_name_id'));
     } catch (Exception $ex) {
         $this->db->rollback();
         throw $ex;
     }
     $this->db->commit();
 }