/** * Initialize a new data object. */ public function __construct($params = null) { global $wpdb; $this->db = $wpdb; // Set parameters. // if ($params != null && is_array($params)) { foreach ($params as $key => $value) { $this->{$key} = $value; } } // Collation // $collate = ''; if ($this->db->has_cap('collation')) { if (!empty($this->db->charset)) { $collate .= "DEFAULT CHARACTER SET {$this->db->charset}"; } if (!empty($this->db->collate)) { $collate .= " COLLATE {$this->db->collate}"; } } $this->collate = $collate; // Legacy stuff - replace with data property below. // $this->info = array('table' => $this->db->prefix . 'store_locator', 'query' => array('selectthis' => 'SELECT %s FROM ' . $this->db->prefix . 'store_locator ')); $this->add_filters(); $this->set_properties(); }
/** * Initialize a new data object. * */ public function SLPlus_Data($params = null) { global $wpdb; $this->db = $wpdb; // Collation // $collate = ''; if ($this->db->has_cap('collation')) { if (!empty($this->db->charset)) { $collate .= "DEFAULT CHARACTER SET {$this->db->charset}"; } if (!empty($this->db->collate)) { $collate .= " COLLATE {$this->db->collate}"; } } $this->collate = $collate; // Legacy stuff - replace with data property below. // $this->info = array('table' => $this->db->prefix . 'store_locator', 'query' => array('selectthis' => 'SELECT %s FROM ' . $this->db->prefix . 'store_locator ')); }
function has_cap($db_cap) { switch ($this->dbType) { case 'sqlite': switch (strtolower($db_cap)) { case 'collation': // @since 2.5.0 // @since 2.5.0 case 'group_concat': // @since 2.7 return false; case 'subqueries': // @since 2.7 return true; break; default: return false; } break; default: return parent::has_cap($db_cap); } }