當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。