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


PHP Where::count方法代码示例

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


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

示例1: processWhere

 protected function processWhere(PlatformInterface $platform, DriverInterface $driver = null, ParameterContainer $parameterContainer = null)
 {
     if ($this->where->count() == 0) {
         return;
     }
     return [$this->processExpression($this->where, $platform, $driver, $parameterContainer, 'where')];
 }
开发者ID:KBO-Techo-Dev,项目名称:MagazinePro-zf25,代码行数:7,代码来源:Select.php

示例2: getSqlString

 /**
  * Get SQL string for statement
  *
  * @param  null|PlatformInterface $adapterPlatform If null, defaults to Sql92
  * @return string
  */
 public function getSqlString(PlatformInterface $adapterPlatform = null)
 {
     $adapterPlatform = $adapterPlatform ?: new Sql92();
     $table = $this->table;
     $schema = null;
     // create quoted table name to use in update processing
     if ($table instanceof TableIdentifier) {
         list($table, $schema) = $table->getTableAndSchema();
     }
     $table = $adapterPlatform->quoteIdentifier($table);
     if ($schema) {
         $table = $adapterPlatform->quoteIdentifier($schema) . $adapterPlatform->getIdentifierSeparator() . $table;
     }
     $set = $this->set;
     if (is_array($set)) {
         $setSql = array();
         foreach ($set as $column => $value) {
             if ($value instanceof Expression) {
                 $exprData = $this->processExpression($value, $adapterPlatform);
                 $setSql[] = $adapterPlatform->quoteIdentifier($column) . ' = ' . $exprData->getSql();
             } elseif ($value === null) {
                 $setSql[] = $adapterPlatform->quoteIdentifier($column) . ' = NULL';
             } else {
                 $setSql[] = $adapterPlatform->quoteIdentifier($column) . ' = ' . $adapterPlatform->quoteValue($value);
             }
         }
         $set = implode(', ', $setSql);
     }
     $sql = sprintf($this->specifications[static::SPECIFICATION_UPDATE], $table, $set);
     if ($this->where->count() > 0) {
         $whereParts = $this->processExpression($this->where, $adapterPlatform, null, 'where');
         $sql .= ' ' . sprintf($this->specifications[static::SPECIFICATION_WHERE], $whereParts->getSql());
     }
     return $sql;
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:41,代码来源:Update.php

示例3: processWhere

 protected function processWhere(PlatformInterface $platform, DriverInterface $driver = null, ParameterContainer $parameterContainer = null)
 {
     if ($this->where->count() == 0) {
         return;
     }
     return sprintf($this->specifications[static::SPECIFICATION_WHERE], $this->processExpression($this->where, $platform, $driver, $parameterContainer, 'where'));
 }
开发者ID:KBO-Techo-Dev,项目名称:MagazinePro-zf25,代码行数:7,代码来源:Update.php

示例4: getSqlString

 /**
  * Get SQL string for statement
  *
  * @param  null|PlatformInterface $adapterPlatform If null, defaults to Sql92
  * @return string
  */
 public function getSqlString(PlatformInterface $adapterPlatform = null)
 {
     $adapterPlatform = $adapterPlatform ?: new Sql92();
     $table = $adapterPlatform->quoteIdentifier($this->table);
     $set = $this->set;
     if (is_array($set)) {
         $setSql = array();
         foreach ($set as $column => $value) {
             if ($value instanceof Expression) {
                 $exprData = $this->processExpression($value, $adapterPlatform);
                 $setSql[] = $adapterPlatform->quoteIdentifier($column) . ' = ' . $exprData->getSql();
             } elseif (is_null($value)) {
                 $setSql[] = $adapterPlatform->quoteIdentifier($column) . ' = NULL';
             } else {
                 $setSql[] = $adapterPlatform->quoteIdentifier($column) . ' = ' . $adapterPlatform->quoteValue($value);
             }
         }
         $set = implode(', ', $setSql);
     }
     $sql = sprintf($this->specifications[self::SPECIFICATION_UPDATE], $table, $set);
     if ($this->where->count() > 0) {
         $whereParts = $this->processExpression($this->where, $adapterPlatform, null, 'where');
         $sql .= ' ' . sprintf($this->specifications[self::SPECIFICATION_WHERE], $whereParts->getSql());
     }
     return $sql;
 }
开发者ID:haoyanfei,项目名称:zf2,代码行数:32,代码来源:Update.php

示例5: processWhere

 protected function processWhere(PlatformInterface $platform, Adapter $adapter = null, ParameterContainer $parameterContainer = null)
 {
     if ($this->where->count() == 0) {
         return null;
     }
     $whereParts = $this->processExpression($this->where, $platform, $adapter, $this->processInfo['paramPrefix'] . 'where');
     if ($parameterContainer) {
         $parameterContainer->merge($whereParts->getParameterContainer());
     }
     return array($whereParts->getSql());
 }
开发者ID:Rovak,项目名称:zf2,代码行数:11,代码来源:Select.php

示例6: processWhere

 protected function processWhere(PlatformInterface $platform, Adapter $adapter = null, ParameterContainer $parameterContainer = null)
 {
     if ($this->where->count() == 0) {
         return null;
     }
     $whereParts = $this->processExpression($this->where, $platform, $adapter ? $adapter->getDriver() : null, 'where');
     if (count($whereParts['parameters']) > 0) {
         $parameterContainer->merge($whereParts['parameters']);
     }
     return array($whereParts['sql']);
 }
开发者ID:nazrulworld,项目名称:zf2,代码行数:11,代码来源:Select.php

示例7: getSqlString

 /**
  * Get the SQL string, based on the platform
  *
  * Platform defaults to Sql92 if none provided
  *
  * @param  null|PlatformInterface $adapterPlatform
  * @return string
  */
 public function getSqlString(PlatformInterface $adapterPlatform = null)
 {
     $adapterPlatform = $adapterPlatform ?: new Sql92();
     $table = $adapterPlatform->quoteIdentifier($this->table);
     //        if ($this->schema != '') {
     //            $table = $platform->quoteIdentifier($this->schema) . $platform->getIdentifierSeparator() . $table;
     //        }
     $sql = sprintf($this->specifications[self::SPECIFICATION_DELETE], $table);
     if ($this->where->count() > 0) {
         $whereParts = $this->processExpression($this->where, $adapterPlatform, null, 'where');
         $sql .= ' ' . sprintf($this->specifications[self::SPECIFICATION_WHERE], $whereParts['sql']);
     }
     return $sql;
 }
开发者ID:robertodormepoco,项目名称:zf2,代码行数:22,代码来源:Delete.php

示例8: getSqlString

 /**
  * Get the SQL string, based on the platform
  *
  * Platform defaults to Sql92 if none provided
  *
  * @param  null|PlatformInterface $adapterPlatform
  * @return string
  */
 public function getSqlString(PlatformInterface $adapterPlatform = null)
 {
     $adapterPlatform = $adapterPlatform ?: new Sql92();
     $table = $this->table;
     $schema = null;
     // create quoted table name to use in delete processing
     if ($table instanceof TableIdentifier) {
         list($table, $schema) = $table->getTableAndSchema();
     }
     $table = $adapterPlatform->quoteIdentifier($table);
     if ($schema) {
         $table = $adapterPlatform->quoteIdentifier($schema) . $adapterPlatform->getIdentifierSeparator() . $table;
     }
     $sql = sprintf($this->specifications[static::SPECIFICATION_DELETE], $table);
     if ($this->where->count() > 0) {
         $whereParts = $this->processExpression($this->where, $adapterPlatform, null, 'where');
         $sql .= ' ' . sprintf($this->specifications[static::SPECIFICATION_WHERE], $whereParts->getSql());
     }
     return $sql;
 }
开发者ID:tejdeeps,项目名称:tejcs.com,代码行数:28,代码来源:Delete.php

示例9: getSqlString

    /**
     * Get SQL string for statement
     * 
     * @param  null|PlatformInterface $adapterPlatform If null, defaults to Sql92
     * @return string
     */
    public function getSqlString(PlatformInterface $adapterPlatform = null)
    {
        $adapterPlatform = ($adapterPlatform) ?: new Sql92;
        $table = $adapterPlatform->quoteIdentifier($this->table);

        $set = $this->set;
        if (is_array($set)) {
            $setSql = array();
            foreach ($set as $setName => $setValue) {
                $setSql[] = $adapterPlatform->quoteIdentifier($setName) . ' = ' . $adapterPlatform->quoteValue($setValue);
            }
            $set = implode(', ', $setSql);
        }

        $sql = sprintf($this->specifications[self::SPECIFICATION_UPDATE], $table, $set);
        if ($this->where->count() > 0) {
            $whereParts = $this->processExpression($this->where, $adapterPlatform, null, 'where');
            $sql .= ' ' . sprintf($this->specifications[self::SPECIFICATION_WHERE], $whereParts['sql']);
        }
        return $sql;
    }
开发者ID:necrogami,项目名称:zf2,代码行数:27,代码来源:Update.php


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