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


PHP Jam::delete方法代码示例

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


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

示例1: __construct

 public function __construct($id = NULL)
 {
     parent::__construct($id);
     if (mt_rand(1, 100) === 1) {
         Jam::delete($this)->expired()->execute();
     }
 }
开发者ID:Konro1,项目名称:pms,代码行数:7,代码来源:Token.php

示例2: test_expired

 public function test_expired()
 {
     $current_time = time();
     $expected_sql = "DELETE FROM `test_user_tokens` WHERE `test_user_tokens`.`expires` < {$current_time}";
     $sql = (string) Jam::delete('test_user_token')->expired(TRUE, $current_time);
     $this->assertEquals($expected_sql, $sql);
 }
开发者ID:Konro1,项目名称:pms,代码行数:7,代码来源:UserTokenTest.php

示例3: _delete_item

 /**
  * Delete an item with a specific key from the database
  * @param  string $foreign_model
  * @param  string $key
  * @return Database_Result
  */
 protected function _delete_item($foreign_model, $key)
 {
     if (!$foreign_model) {
         return NULL;
     }
     return Jam::delete($foreign_model)->where_key($key)->execute();
 }
开发者ID:openbuildings,项目名称:jam,代码行数:13,代码来源:Belongsto.php

示例4: erase_query

 public function erase_query(Jam_Model $model)
 {
     $descendant_ids = $this->descendants_query($model->id())->where($this->depth_key, '>', 0)->execute($model->meta()->db())->as_array(NULL, $this->descendant_key);
     return Jam::delete($this->foreign_model)->where_key($descendant_ids);
 }
开发者ID:openbuildings,项目名称:jam-closuretable,代码行数:5,代码来源:Children.php

示例5: delete

 /**
  * Deletes a single record.
  *
  * @return  boolean
  **/
 public function delete()
 {
     $result = FALSE;
     // Are we loaded? Then we're just deleting this record
     if ($this->_loaded) {
         $key = $this->_original[$this->meta()->primary_key()];
         if (($result = $this->meta()->events()->trigger('model.before_delete', $this)) !== FALSE) {
             $result = Jam::delete($this)->where_key($key)->execute();
         }
     }
     // Trigger the after-delete
     $this->meta()->events()->trigger('model.after_delete', $this, array($result));
     // Clear the object so it appears deleted anyway
     $this->clear();
     // Set the flag indicatig the model has been successfully deleted
     $this->_deleted = $result;
     return $this->_deleted;
 }
开发者ID:openbuildings,项目名称:jam,代码行数:23,代码来源:Model.php


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