当前位置: 首页>>代码示例>>PHP>>正文


PHP Query::generateDeleteStm方法代码示例

本文整理汇总了PHP中Query::generateDeleteStm方法的典型用法代码示例。如果您正苦于以下问题:PHP Query::generateDeleteStm方法的具体用法?PHP Query::generateDeleteStm怎么用?PHP Query::generateDeleteStm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Query的用法示例。


在下文中一共展示了Query::generateDeleteStm方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: delete

 function delete($comm)
 {
     parent::delete($comm, self::OBJECT_CLASS);
     $rs = $this->db->execute($s = Query::generateDeleteStm($this->table, array(new WhereConstraint($this->table->getColumn(DB::COMMENT_ID), Operator::EQUAL, $comm->getID()))), $this->table->getName(), $comm);
     if ($this->db->affected_rows() != 1) {
         throw new Exception("Errore durante l'eliminazione dell'oggetto.");
     }
     return $comm;
 }
开发者ID:Esisto,项目名称:IoEsisto,代码行数:9,代码来源:CommentDao.php

示例2: delete

 function delete($report)
 {
     parent::delete($report, self::OBJECT_CLASS);
     $rs = $this->db->execute($s = Query::generateDeleteStm($this->table, array(new WhereConstraint($this->table->getColumn(DB::REPORT_ID), Operator::EQUAL, intval($report->getID())))), $this->table->getName(), $report);
     if ($this->db->affected_rows() != 1) {
         throw new Exception("Si è verificato un errore eliminando il dato. Riprovare.");
     }
     return $report;
 }
开发者ID:Esisto,项目名称:IoEsisto,代码行数:9,代码来源:ReportDao.php

示例3: delete

 function delete($author, $post)
 {
     parent::delete($author, "User");
     parent::delete($author, "Post");
     $rs = $this->db->execute($s = Query::generateDeleteStm($this->table, array(new WhereConstraint($this->table->getColumn(DB::VOTE_AUTHOR), Operator::EQUAL, intval($author->getID())), new WhereConstraint($this->table->getColumn(DB::VOTE_POST), Operator::EQUAL, intval($post->getID())))), $this->table->getName(), array("Vote", intval($author->getID()), intval($post->getID())));
     if ($this->db->affected_rows() != 1) {
         throw new Exception("Si è verificato un errore eliminando l'oggetto. Riprovare.");
     }
     return true;
 }
开发者ID:Esisto,项目名称:IoEsisto,代码行数:10,代码来源:VoteDao.php

示例4: delete

 function delete($contact)
 {
     parent::delete($contact, self::OBJECT_CLASS);
     $this->db->execute(Query::generateDeleteStm($this->table, array(new WhereConstraint($this->table->getColumn(DB::CONTACT_ID), Operator::EQUAL, $contact->getID()))), $this->table->getName(), $contact);
     //salvo la risorsa nella storia.
     $this->saveHistory($contact, "DELETED");
     if ($this->db->affected_rows() != 1) {
         throw new Exception("Si è verificato un errore eliminando il dato. Riprovare.");
     }
     return $contact;
 }
开发者ID:Esisto,项目名称:IoEsisto,代码行数:11,代码来源:ContactDao.php

示例5: delete

 function delete($user)
 {
     parent::delete($user, self::OBJECT_CLASS);
     //carico la risorsa, completa dei suoi derivati (che andrebbero persi).
     $loadR = $this->loadReports;
     $this->loadReports = true;
     $loadD = $this->loadDependences;
     $this->loadDependences = true;
     $u_complete = null;
     try {
         $u_complete = $this->load($user->getID());
         $this->loadReports = $loadR;
         $this->loadDependences = $loadD;
     } catch (Exception $e) {
         $this->loadReports = $loadR;
         $this->loadDependences = $loadD;
         throw $e;
     }
     $this->db->execute(Query::generateDeleteStm($this->table, array(new WhereConstraint($this->table->getColumn(DB::USER_ID), Operator::EQUAL, $user->getID()))), $this->table->getName(), $user);
     //salvo la risorsa nella storia.
     $this->saveHistory($u_complete, "DELETED");
     if ($this->db->affected_rows() != 1) {
         throw new Exception("Si è verificato un errore eliminando il dato. Riprovare.");
     }
     return $user;
 }
开发者ID:Esisto,项目名称:IoEsisto,代码行数:26,代码来源:UserDao.php

示例6: delete

 function delete($post)
 {
     parent::delete($post, self::OBJECT_CLASS);
     //carico il post, completo dei suoi derivati (che andrebbero persi) esclusi i voti.
     $loadC = $this->loadComments;
     $this->loadComments = true;
     $loadR = $this->loadReports;
     $this->loadReports = true;
     $p_complete = null;
     try {
         $p_complete = $this->load($post->getID());
         $this->loadComments = $loadC;
         $this->loadReports = $loadR;
     } catch (Exception $e) {
         $this->loadComments = $loadC;
         $this->loadReports = $loadR;
         throw $e;
     }
     $this->db->execute($s = Query::generateDeleteStm($this->table, array(new WhereConstraint($this->table->getColumn(DB::POST_ID), Operator::EQUAL, $post->getID()))), $this->table->getName(), $post);
     //salvo il post nella storia.
     $this->saveHistory($p_complete, "DELETED");
     if ($this->db->affected_rows() != 1) {
         throw new Exception("Si è verificato un errore eliminando il dato. Riprovare.");
     }
     return $post;
 }
开发者ID:Esisto,项目名称:IoEsisto,代码行数:26,代码来源:PostDao.php

示例7: delete

 function delete()
 {
     require_once "query.php";
     $db = new DBManager();
     if (!$db->connect_errno()) {
         $table = Query::getDBSchema()->getTable(TABLE_RESOURCE);
         $rs = $db->execute($s = Query::generateDeleteStm($table, array(new WhereConstraint($table->getColumn(RESOURCE_ID), Operator::EQUAL, $this->getID()))), $table->getName(), $this);
         //echo "<br />" . $s; //DEBUG
         if ($db->affected_rows() == 1) {
             return $this;
         } else {
             $db->display_error("Resource::delete()");
         }
     } else {
         $db->display_connect_error("Resource::delete()");
     }
     return false;
 }
开发者ID:Esisto,项目名称:IoEsisto,代码行数:18,代码来源:common.php

示例8: unsubscribePost

 function unsubscribePost($post, $contest)
 {
     parent::delete($contest, self::OBJECT_CLASS);
     if (!is_subclass_of($post, "Post")) {
         throw new Exception("Attenzione! Il parametro di ricerca non è un post.");
     }
     if (time() > $contest->getEnd()) {
         throw new Exception("Questo contest è chiuso, non puoi cancellare la tua iscrizione.");
     }
     $this->db->execute($s = Query::generateDeleteStm($this->table_cs, array(new WhereConstraint($this->table_cs->getColumn(DB::CONTEST_SUBSCRIBER_POST), Operator::EQUAL, $post->getID()), new WhereConstraint($this->table_cs->getColumn(DB::CONTEST_SUBSCRIBER_CONTEST), Operator::EQUAL, $this->getID()))), $this->table_cs->getName(), $contest);
     if ($this->db->affected_rows() != 1) {
         throw new Exception("Si è verificato un errore eliminando l'oggetto. Riprovare.");
     }
     //$this->loadSubscribers($contest); //FIXME vale la pena ricaricare il contest?
     return $contest;
 }
开发者ID:Esisto,项目名称:IoEsisto,代码行数:16,代码来源:ContestDao.php

示例9: delete

 function delete()
 {
     if ($this->getName() == MAILBOX) {
         return false;
     }
     //la mailbox non si può eliminare.
     require_once "query.php";
     $db = new DBManager();
     if (!$db->connect_errno()) {
         define_tables();
         defineMailDirColumns();
         $table = Query::getDBSchema()->getTable(TABLE_MAIL_DIRECTORY);
         //cerco la Mailbox dell'utente e sposto tutte le mail lì.
         $db->execute($s = Query::generateSelectStm(array($table), array(), array(new WhereConstraint($table->getColumn(MAIL_DIRECTORY_OWNER), Operator::EQUAL, $this->owner), new WhereConstraint($table->getColumn(MAIL_DIRECTORY_NAME), Operator::EQUAL, MAILBOX)), array()), $table->getName(), $this);
         if ($db->num_rows() == 1) {
             $row = $db->fetch_result();
             $mailboxid = intval($row[MAIL_DIRECTORY_ID]);
             $table1 = Query::getDBSchema()->getTable(TABLE_MAIL_IN_DIRECTORY);
             $db->execute($s = Query::generateUpdateStm($table1, array(MAIL_IN_DIRECTORY_DIRECTORY => intval($mailboxid)), array(new WhereConstraint($table1->getColumn(MAIL_IN_DIRECTORY_DIRECTORY), Operator::EQUAL, $this->getID()))), $table1->getName(), $this);
             if ($db->affected_rows() == count($this->getMails())) {
                 $rs = $db->execute($s = Query::generateDeleteStm($table, array(new WhereConstraint($table->getColumn(MAIL_DIRECTORY_ID), Operator::EQUAL, $this->getID()))), $table->getName(), $this);
                 //echo "<br />" . $db->affected_rows() . $s; //DEBUG
                 if ($db->affected_rows() == 1) {
                     return $this;
                 } else {
                     $db->display_error("MailDirectory::delete()");
                 }
             } else {
                 $db->display_error("MailDirectory::delete()");
             }
         } else {
             $db->display_error("MailDirectory::delete()");
         }
     } else {
         $db->display_connect_error("MailDirectory::delete()");
     }
     return false;
 }
开发者ID:Esisto,项目名称:IoEsisto,代码行数:38,代码来源:Mail.php

示例10: removeFollower

 function removeFollower($user)
 {
     require_once "query.php";
     $db = new DBManager();
     if (!$db->connect_errno()) {
         define_tables();
         defineFollowColumns();
         $table = Query::getDBSchema()->getTable(TABLE_FOLLOW);
         $db->execute($s = Query::generateDeleteStm($table, array(new WhereConstraint($table->getColumn(FOLLOW_FOLLOWER), Operator::EQUAL, $user->getID()), new WhereConstraint($table->getColumn(FOLLOW_SUBJECT), Operator::EQUAL, $this->getID()))), $table->getName(), $this);
         if ($db->affected_rows() > 1) {
             $db->display_error("User::removeFollower()");
         }
         //Genera un errore ma ritorna comunque $this
     } else {
         $db->display_connect_error("User::removeFollower()");
     }
     return $this->loadFollowers();
 }
开发者ID:Esisto,项目名称:IoEsisto,代码行数:18,代码来源:FollowDao.php

示例11: delete

 function delete()
 {
     require_once "query.php";
     $db = new DBManager();
     if (!$db->connect_errno()) {
         define_tables();
         defineVoteColumns();
         $table = Query::getDBSchema()->getTable(TABLE_VOTE);
         $rs = $db->execute($s = Query::generateDeleteStm($table, array(new WhereConstraint($table->getColumn(VOTE_AUTHOR), Operator::EQUAL, $this->getAuthor()), new WhereConstraint($table->getColumn(VOTE_POST), Operator::EQUAL, $this->getPost()))), $table->getName(), $this);
         //echo "<br />" . $s; //DEBUG
         if ($db->affected_rows() == 1) {
             return $this;
         } else {
             $db->display_error("Vote::delete()");
         }
     } else {
         $db->display_connect_error("Vote::delete()");
     }
     return false;
 }
开发者ID:Esisto,项目名称:IoEsisto,代码行数:20,代码来源:PostCommon.php


注:本文中的Query::generateDeleteStm方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。