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


PHP Data::delete方法代码示例

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


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

示例1: erase

 public function erase($key = null)
 {
     if (null === $key) {
         $delete = parent::delete('thinsession', $this->_session->getId());
         return new self($this->_sessionName);
     } else {
         $data = $this->_session->getData();
         $data->{$key} = null;
         return $this->save();
     }
 }
开发者ID:schpill,项目名称:thin,代码行数:11,代码来源:Sessionbis.php

示例2: forget

 /**
  * Delete an item from the cache.
  *
  * @param  string  $key
  * @return void
  */
 public function forget($key)
 {
     $this->_cleanCache();
     $res = Data::query('cache', 'key = ' . $key . ' && namespace = ' . $this->namespace);
     if (count($res)) {
         $obj = Data::getObject(current($res));
         $del = Data::delete('cache', $obj->getId());
     }
 }
开发者ID:schpill,项目名称:thin,代码行数:15,代码来源:Cachedata.php

示例3: Config

<?php

// check if value was posted
// include database and object file
include_once 'includes/config.php';
include_once 'includes/data.inc.php';
// get database connection
$database = new Config();
$db = $database->getConnection();
// prepare product object
$product = new Data($db);
// set product id to be deleted
$product->id = isset($_GET['id']) ? $_GET['id'] : die('ERROR: missing ID.');
// delete the product
if ($product->delete()) {
    echo "<script>location.href='index.php'</script>";
} else {
    echo "<script>alert('Gagal menghapus data')</script>";
}
开发者ID:hendisantika,项目名称:crudpdo,代码行数:19,代码来源:delete.php

示例4: delete

 /**
  * Get a DELETE variable in the request.
  *
  * @param string $k The key.
  *
  * @return string
  */
 public function delete($k = null)
 {
     return \Data::delete($k);
 }
开发者ID:discophp,项目名称:framework,代码行数:11,代码来源:Request.class.php

示例5: deleteTied

 private function deleteTied($exemplars)
 {
     if (is_object($exemplars)) {
         $exemplars = [$exemplars];
     }
     $result = true;
     foreach ($exemplars as $exemplar) {
         foreach ($this->ties as $tie) {
             if (!isset($exemplar->{$tie->key})) {
                 throw new \Exception("Key doesn't exists in exemplar");
             }
             $tie->ids = $exemplar->{$tie->key};
             $criterion = ['where' => ['query' => "`{$this->table}_{$this->primary_field}`=?", 'vars' => $tie->ids]];
             $TieData = new Data($this->Db, $tie->name);
             $result = $TieData->delete($criterion, $tie->deletion_type);
         }
     }
     return $result;
 }
开发者ID:Qclanton,项目名称:testblog,代码行数:19,代码来源:Qdata.php


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