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


PHP JDatabase::getPrefix方法代码示例

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


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

示例1: saveRule

 public function saveRule()
 {
     $refTab = JRequest::getVar('reference_table', '');
     $pfx = $this->db->getPrefix();
     $tab = $this->str_replace_first($refTab, $pfx, '');
     $this->db->setQuery("\n\t\t\n\t\t\tInsert \n\t\t\tInto \n\t\t\t\t#__facileforms_integrator_rules\n\t\t\t(\n\t\t\t\tname,\n\t\t\t\tform_id,\n\t\t\t\treference_table,\n\t\t\t\ttype\n\t\t\t) \n\t\t\tValues\n\t\t\t(\n\t\t\t\t" . $this->db->Quote(JRequest::getVar('rule_name')) . ",\n\t\t\t\t" . $this->db->Quote(JRequest::getVar('form_id')) . ",\n\t\t\t\t" . $this->db->Quote($tab) . ",\n\t\t\t\t" . $this->db->Quote(JRequest::getVar('type')) . "\n\t\t\t)\n\t\t\n\t\t");
     $this->db->query();
     $ruleId = $this->db->insertid();
     return $ruleId;
 }
开发者ID:Ettore495,项目名称:Ettore-Work,代码行数:10,代码来源:integrator.class.php

示例2: saveRule

	public function saveRule(){
		$refTab = JRequest::getVar('reference_table', '');
		$pfx    = $this->db->getPrefix();
		$tab = $this->str_replace_first($refTab, $pfx, '');
		
		$this->db->setQuery("
		
			Insert 
			Into 
				#__facileforms_integrator_rules
			(
				name,
				form_id,
				reference_table,
				type
			) 
			Values
			(
				".$this->db->Quote(JRequest::getVar('rule_name')).",
				".$this->db->Quote(JRequest::getVar('form_id')).",
				".$this->db->Quote($tab).",
				".$this->db->Quote(JRequest::getVar('type'))."
			)
		
		");
		$this->db->query();
		
		$ruleId = $this->db->insertid();
		
		
		return $ruleId;
	}
开发者ID:rkern21,项目名称:videoeditor,代码行数:32,代码来源:integrator.class.php

示例3: testGetPrefix

	/**
	 * Tests the JDatabase::getPrefix method.
	 *
	 * @return  void
	 *
	 * @since   11.4
	 */
	public function testGetPrefix()
	{
		$this->assertThat(
			$this->db->getPrefix(),
			$this->equalTo('&')
		);
	}
开发者ID:robschley,项目名称:joomla-platform,代码行数:14,代码来源:JDatabaseTest.php

示例4: replacePrefix

 /**
  * Sostituisce #__ con il prefisso del database
  * @param string $q
  * @return string
  */
 private function replacePrefix($q)
 {
     return str_replace("#__", $this->db->getPrefix(), $q);
 }
开发者ID:alesconti,项目名称:FF_2015,代码行数:9,代码来源:ProPayment_Database.php

示例5: replacePrefix

 /**
  * Quick utility method to replace the mysql prefix used in the joomla tables with the real prefix
  *
  * @param string $sql The sql query
  * @param string $prefix The prefix to search for (default: #__)
  *
  * @return string The query with the real prefix
  *
  * @since 1.0.0
  */
 public function replacePrefix($sql, $prefix = '#__')
 {
     return preg_replace('/' . preg_quote($prefix) . '/', $this->_database->getPrefix(), $sql);
 }
开发者ID:JBZoo,项目名称:Zoo-Changelog,代码行数:14,代码来源:database.php

示例6: __toString

 /**
  * Magic function to convert the query to a string.
  * @return  string    The completed query.
  */
 public function __toString()
 {
     $query = '';
     switch ($this->type) {
         case 'element':
             $query .= (string) $this->element;
             break;
         case 'select':
             if (is_null($this->select)) {
                 $this->select = '*';
             }
             $query .= (string) $this->select;
             $query .= (string) $this->from;
             if ($this->join) {
                 $this->join = array_unique($this->join);
                 foreach ($this->join as $join) {
                     $query .= (string) $join . PHP_EOL;
                 }
             }
             if ($this->where) {
                 $query .= (string) $this->where;
             }
             if ($this->group) {
                 $query .= (string) $this->group;
             }
             if ($this->having) {
                 $query .= (string) $this->having;
             }
             if ($this->order) {
                 $query .= (string) $this->order;
             }
             break;
         case 'delete':
             $query .= (string) $this->delete;
             $query .= (string) $this->from;
             if ($this->join) {
                 $this->join = array_unique($this->join);
                 foreach ($this->join as $join) {
                     $query .= (string) $join;
                 }
             }
             if ($this->where) {
                 $query .= (string) $this->where;
             }
             break;
         case 'update':
             $query .= (string) $this->update;
             $query .= (string) $this->set;
             if ($this->where) {
                 $query .= (string) $this->where;
             }
             break;
         case 'insert':
             $query .= (string) $this->insert;
             // Set method
             if ($this->set) {
                 $query .= (string) $this->set;
             } elseif ($this->values) {
                 if ($this->columns) {
                     $query .= (string) $this->columns;
                 }
                 $query .= ' VALUES ';
                 $query .= (string) $this->values;
             }
             break;
         case 'replace':
             $query .= (string) $this->replace;
             // Set method
             if ($this->set) {
                 $query .= (string) $this->set;
             } elseif ($this->values) {
                 if ($this->columns) {
                     $query .= (string) $this->columns;
                 }
                 $query .= ' VALUES ';
                 $query .= (string) $this->values;
             }
             break;
     }
     if ($this->limit) {
         $query .= (string) $this->limit;
     }
     $query = str_replace('#__', $this->db->getPrefix(), $query);
     return $query;
 }
开发者ID:alexmixaylov,项目名称:real,代码行数:89,代码来源:JBDatabaseQuery.php


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