本文整理汇总了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')];
}
示例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;
}
示例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'));
}
示例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;
}
示例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());
}
示例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']);
}
示例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;
}
示例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;
}
示例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;
}