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


PHP Am_Query::escape方法代码示例

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


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

示例1: getQuery

 /** @return Am_Query */
 public function getQuery()
 {
     $q = new Am_Query(new InvoicePaymentTable(), 'p');
     $q->clearFields();
     foreach ($this->getPaysystems() as $k => $ps) {
         $ps = $q->escape($ps);
         $q->addField("ROUND(SUM(IF(p.paysys_id={$ps}, p.amount/p.base_currency_multi, 0)),2)\n", 'amt_' . $k);
     }
     return $q;
 }
开发者ID:subashemphasize,项目名称:test_site,代码行数:11,代码来源:Standard.php

示例2: _getWhere

 public function _getWhere(Am_Query $q)
 {
     if (!$this->id) {
         return null;
     }
     $id = $q->escape($this->id);
     return "itd.value = {$id}";
 }
开发者ID:alexanderTsig,项目名称:arabic,代码行数:8,代码来源:User.php

示例3: __construct

 public function __construct(Am_Request $request, Am_View $view)
 {
     $di = Am_Di::getInstance();
     $ds = null;
     $i = 0;
     $key = null;
     foreach ($di->resourceAccessTable->getAccessTables() as $k => $t) {
         $q = new Am_Query($t);
         $q->clearFields();
         if (empty($key)) {
             $key = $t->getKeyField();
         }
         $q->addField($t->getKeyField(), $key);
         $type = $t->getAccessType();
         $q->addField("'{$type}'", 'resource_type');
         $q->addField($t->getTitleField(), 'title');
         $q->addField($q->escape($t->getAccessTitle()), 'type_title');
         $q->addField($q->escape($t->getPageId()), 'page_id');
         if ($t instanceof EmailTemplateTable) {
             $q->addWhere('name IN (?a)', array(EmailTemplate::AUTORESPONDER, EmailTemplate::EXPIRE));
         }
         if (empty($ds)) {
             $ds = $q;
         } else {
             $ds->addUnion($q);
         }
     }
     // yes we need that subquery in subquery to mask field names
     // to get access of fields of main query (!)
     $ds->addOrderRaw("(SELECT _sort_order\n             FROM ( SELECT sort_order as _sort_order,\n                    resource_type as _resource_type,\n                    resource_id as _resource_id\n                  FROM ?_resource_access_sort ras) AS _ras\n             WHERE _resource_id={$key} AND _resource_type=resource_type LIMIT 1),\n             {$key}, resource_type");
     parent::__construct('_all', ___('All Content'), $ds, $request, $view, $di);
     $this->addField('type_title', ___('Type'));
     $this->addField('title', ___('Title'));
     if ($this->getDi()->db->selectCell("SELECT COUNT(*) FROM ?_resource_resource_category")) {
         $this->addField(new Am_Grid_Field('rgroup', ___('Categories'), false))->setRenderFunction(array($this, 'renderCategory'));
     }
     $this->actionDelete('insert');
     $this->actionDelete('edit');
     $this->actionDelete('delete');
     $this->actionAdd(new Am_Grid_Action_ContentAllEdit('edit', ___('Edit'), ''));
     $this->actionAdd(new Am_Grid_Action_SortContent());
 }
开发者ID:alexanderTsig,项目名称:arabic,代码行数:42,代码来源:AdminContentController.php

示例4:

 function _getWhere(Am_Query $q)
 {
     $field = $this->checkBlob ? $this->selfAlias() . '.`blob`' : $this->selfAlias() . '.`value`';
     $ret = $field . ' ' . $this->op;
     if ($this->op != 'IS NULL' && $this->op != 'IS NOT NULL') {
         $ret .= ' ' . $q->escape($this->value);
     }
     return $ret;
 }
开发者ID:irovast,项目名称:eyedock,代码行数:9,代码来源:Query.php


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