當前位置: 首頁>>代碼示例>>PHP>>正文


PHP sDB::clean方法代碼示例

本文整理匯總了PHP中sDB::clean方法的典型用法代碼示例。如果您正苦於以下問題:PHP sDB::clean方法的具體用法?PHP sDB::clean怎麽用?PHP sDB::clean使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在sDB的用法示例。


在下文中一共展示了sDB::clean方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: copydata

 /**
  * Copy property values into the current DatbaseObject from another object
  *
  * Copies the property values from a specified object into the current
  * ShoppDatabaseObject where the property names match.
  *
  * @author Jonathan Davis
  * @since 1.0
  *
  * @param object $data The source object or array to copy from
  * @param string $prefix (optional) A property prefix
  * @param array $ignores (optional) List of property names to ignore copying from
  * @return void
  **/
 public function copydata($data, $prefix = '', array $ignores = array('_datatypes', '_table', '_key', '_lists', '_map', 'id', 'created', 'modified'))
 {
     if (!is_array($ignores)) {
         $ignores = array();
     }
     $properties = is_object($data) ? get_object_vars($data) : $data;
     foreach ((array) $properties as $property => $value) {
         $property = $prefix . $property;
         if (property_exists($this, $property) && !in_array($property, $ignores)) {
             $this->{$property} = sDB::clean($value);
         }
     }
 }
開發者ID:crunnells,項目名稱:shopp,代碼行數:27,代碼來源:DB.php

示例2: download_loader

 /**
  * Download record loader to map download file data to the loaded downloads for the customer
  *
  * @author Jonathan Davis
  * @since 1.3.2
  *
  * @param array $records The records to map to (unused becase they are mapped to the Customer->downloads records)
  * @param array $record	The record data loaded from the query
  * @return void
  **/
 public function download_loader(&$records, &$record)
 {
     // Lookup the download key
     if (empty($this->_filemap[$record->id])) {
         return;
     }
     $dkey = $this->_filemap[$record->id];
     // Find the purchased download
     if (empty($this->downloads[$dkey])) {
         return;
     }
     $Purchased =& $this->downloads[$dkey];
     // Unserialize the file data
     $data = maybe_unserialize($record->value);
     if (is_object($data)) {
         $properties = get_object_vars($data);
     } else {
         return;
     }
     // Map the file data to the purchased download record
     foreach ((array) $properties as $property => $value) {
         $Purchased->{$property} = sDB::clean($value);
     }
 }
開發者ID:BlessySoftwares,項目名稱:anvelocom,代碼行數:34,代碼來源:Customer.php

示例3: load_purchased

 /**
  * Loads or constructs item properties from a purchased product
  *
  * @author Jonathan Davis
  * @since 1.3
  *
  * @return void
  **/
 public function load_purchased($Purchased)
 {
     $this->load(new ShoppProduct($Purchased->product), $Purchased->price, false);
     // Copy matching properties
     $properties = get_object_vars($Purchased);
     foreach ((array) $properties as $property => $value) {
         if (property_exists($this, $property)) {
             $this->{$property} = sDB::clean($value);
         }
     }
 }
開發者ID:borkweb,項目名稱:shopp,代碼行數:19,代碼來源:Item.php

示例4: delete

 /**
  * Remove a setting from the registry and the database
  *
  * @since 1.0
  *
  * @param string $name Name of the setting to remove
  * @return boolean
  **/
 public function delete($name = false)
 {
     $null = null;
     if (empty($name)) {
         return false;
     }
     $Setting = $this->setting();
     $where = array("context='{$Setting->context}'", "type='{$Setting->type}'");
     if (!empty($name)) {
         $where[] = "name='" . sDB::clean($name) . "'";
     }
     $where = join(' AND ', $where);
     if (!sDB::query("DELETE FROM {$this->_table} WHERE {$where}")) {
         return false;
     }
     if (isset($this->registry[$name])) {
         $this->registry[$name] = $null;
     }
     return true;
 }
開發者ID:msigley,項目名稱:shopp,代碼行數:28,代碼來源:Settings.php


注:本文中的sDB::clean方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。