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


PHP ORM::delete方法代码示例

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


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

示例1: delete

 public function delete()
 {
     // delete friend from all your lists
     $this->remove('lists');
     if ($this->is_confirmed()) {
         // friend is friends with you
         // (as well as you being friends with friend)
         // get "you" as seen from your friend's friend list
         $friends_friend = $this->get_reverse_friend();
         // delete friend from your friend list
         // can't do this too soon or we'll loose IDs
         $ret = parent::delete();
         // delete you from friend's friend list
         // (which also deletes you from all friend's lists)
         // this has to be done after $this is deleted
         // othewise we'd get U.N.F.R.I.E.N.D.C.E.P.T.I.O.N.
         // That many dreams within dreams is too unstable!
         try {
             $friends_friend->delete();
         } catch (Kohana_Exception $e) {
             // you're not your friend's friend for some reason
         }
     } else {
         // delete friend from your friend list
         $ret = parent::delete();
     }
     return $ret;
 }
开发者ID:Thanandar,项目名称:GiftCircle,代码行数:28,代码来源:friend.php

示例2: delete

 /**
  * Deletes the a form and all its associated data
  */
 public function delete()
 {
     // Delete all fields associated with this form
     ORM::factory('form_field')->where('form_id', $this->id)->delete_all();
     // Delete the field
     parent::delete();
 }
开发者ID:niiyatii,项目名称:crowdmap,代码行数:10,代码来源:form.php

示例3: delete

 /**
  * Overload delete to include assets
  * when the object is deleted.
  */
 public function delete($id = NULL)
 {
     if ($id === NULL and $this->loaded) {
         #TODO: delete the associated images.
     }
     return parent::delete($id);
 }
开发者ID:plusjade,项目名称:pluspanda-php,代码行数:11,代码来源:testimonial.php

示例4: delete

 /**
  * Override the delete method to clear cache
  */
 public function delete($soft = FALSE)
 {
     parent::delete($soft);
     //cleanup the cache
     Cache::instance('roles')->delete_all();
     return $this;
 }
开发者ID:MenZil-Team,项目名称:cms,代码行数:10,代码来源:role.php

示例5: delete

 public function delete($id = null)
 {
     if (!$this->loaded()) {
         $this->find($id);
     }
     //remove all comment logs for this comment type: comment, comment approved, comment received
     $site = Helper_Game::getSite();
     $gameCommentId = $site->getEvent(Helper_Game::COMMENT)->id;
     $gameCommentApprovedId = $site->getEvent(Helper_Game::COMMENT_APPROVED)->id;
     $gameCommentReceivedId = $site->getEvent(Helper_Game::COMMENT_RECEIVED)->id;
     $infos = ORM::factory("Game_LogInfo")->and_where_open()->where("name", "like", "comment")->or_where("name", "like", "comment_id")->and_where_close()->and_where_open()->where("data", "=", $this->id)->or_where("data", "like", $this->comment)->and_where_close()->find_all();
     foreach ($infos as $info) {
         $log = $info->_eventLog;
         switch ($log->event_id) {
             case $gameCommentId:
             case $gameCommentReceivedId:
                 if ($log->data->comment == $this->id) {
                     $log->delete();
                 }
                 break;
             case $gameCommentApprovedId:
                 if (empty($log->data->comment_id) && $log->item->item_id == $this->photo->id) {
                     $log->delete();
                 }
                 if (!empty($log->data->comment_id) && $log->data->comment_id == $this->id) {
                     $log->delete();
                 }
                 break;
             default:
                 //do nothing
                 break;
         }
     }
     parent::delete($id);
 }
开发者ID:natgeo,项目名称:kids-myshot,代码行数:35,代码来源:comment.php

示例6: delete

 /**
  * Overrides the default delete
  */
 public function delete()
 {
     // Delete locations
     // Delete contacts
     // Delete emergencies
     parent::delete();
 }
开发者ID:bqevin,项目名称:saidika,代码行数:10,代码来源:provider.php

示例7: delete

 public function delete($id = NULL)
 {
     $post = ORM::factory('blog_post', (int) $this->blog_post_id);
     $post->comment_count -= 1;
     $post->save();
     parent::delete($id);
 }
开发者ID:googlecode-mirror,项目名称:s7ncms,代码行数:7,代码来源:blog_comment.php

示例8: delete

 public function delete($id = NULL)
 {
     if (Auth::instance()->get_user()->id == $this->id || Auth::instance()->get_user()->id == $id) {
         return;
     }
     parent::delete($id);
 }
开发者ID:ariol,项目名称:adminshop,代码行数:7,代码来源:User.php

示例9: delete

 /**
  * Overrides the default behaviour to perform
  * extra tasks before removing the channel filter
  * entry 
  */
 public function delete()
 {
     // Delete the channel filter options
     DB::delete('channel_filter_options')->where('channel_filter_id', '=', $this->id)->execute();
     // Default
     parent::delete();
 }
开发者ID:rukku,项目名称:SwiftRiver,代码行数:12,代码来源:filter.php

示例10: delete

 /**
  * @see ORM::delete()
  */
 public function delete($id = null)
 {
     $old = clone $this;
     module::event("group_before_delete", $this);
     parent::delete($id);
     module::event("group_deleted", $old);
 }
开发者ID:andyst,项目名称:gallery3,代码行数:10,代码来源:group.php

示例11: delete

 /**
  * @see ORM::delete()
  */
 public function delete($id = null)
 {
     $old = clone $this;
     module::event("user_before_delete", $this);
     parent::delete($id);
     module::event("user_deleted", $old);
     $this->groups_cache = null;
 }
开发者ID:kandsten,项目名称:gallery3,代码行数:11,代码来源:user.php

示例12: delete

 public function delete()
 {
     if (!$this->loaded()) {
         throw new Kohana_Exception('Method add_guest() must be called on loaded objects');
     }
     ORM::factory('guest')->remove_from_table($this->pk());
     return parent::delete();
 }
开发者ID:hongster,项目名称:mWedding,代码行数:8,代码来源:table.php

示例13: delete

 public function delete()
 {
     if (!$this->loaded()) {
         throw new Kohana_Exception('Media not loaded');
     }
     $this->_unlink();
     return parent::delete();
 }
开发者ID:ZerGabriel,项目名称:cms-1,代码行数:8,代码来源:media.php

示例14: delete

 public function delete()
 {
     $table_prefix = Kohana::config('database.default.table_prefix');
     // Remove records referencing this permission
     // Have to use db->query() since we don't have an ORM model for permissions_roles
     $this->db->query('DELETE FROM ' . $table_prefix . 'permissions_roles WHERE permission_id = ?', $this->id);
     parent::delete();
 }
开发者ID:Dirichi,项目名称:Ushahidi_Web,代码行数:8,代码来源:permission.php

示例15: delete

 /**
  * Simple delete of the object, plus a call to the unify to check to see if the 
  * collection also needs to be deleted. 
  * @return boolean $return, whether or not  the call did everything expected
  */
 public function delete()
 {
     $original = orm::factory('pigment', $this->id);
     $return = parent::delete();
     if ($return) {
         $return = $this->unify($original);
     }
 }
开发者ID:HIVE-Creative,项目名称:spicers,代码行数:13,代码来源:pigment.php


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