當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。