本文整理汇总了PHP中Condition::getCondition方法的典型用法代码示例。如果您正苦于以下问题:PHP Condition::getCondition方法的具体用法?PHP Condition::getCondition怎么用?PHP Condition::getCondition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Condition
的用法示例。
在下文中一共展示了Condition::getCondition方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: extractTypeInfos
/**
* gets a doc comment block as string and tries to extract type information
* from it, storing in the param info array given.
*
* Looks for doc comments like "@param <type> <varname> ....".
*/
protected function extractTypeInfos($docComment, &$paramInfo)
{
$matches = $this->matchParams($docComment);
foreach ($matches['varname'] as $key => $varname) {
if (!empty($matches['type'][$key]) && isset($paramInfo[$varname])) {
$paramInfo[$varname]['type'] = $matches['type'][$key];
$conditionStr = !empty($matches['condition'][$key]) ? $matches['condition'][$key] : null;
if ($conditionStr) {
$cond = Condition::getCondition($paramInfo[$varname]['type'], $conditionStr);
$paramInfo[$varname]['condition'] = $cond;
}
}
}
}
示例2: selectDesc
/**
* @param Condition $_condition
* @return array
*/
public function selectDesc(Condition $_condition)
{
/* ## LOGGER ## */
if (isset($this->logger)) {
$this->logger->DEBUG('select: ' . $_condition->toString());
}
if (empty($_condition)) {
throw new UndefinedRowException('null');
}
$table = $this->connection->escape($this->table);
$primary = $this->connection->escape($this->primary);
$key = $this->connection->escape($_condition->getKey());
$value = $this->connection->escape($_condition->getValue());
$condition = $this->connection->escape($_condition->getCondition());
$sql = 'SELECT * FROM `' . $table . '` WHERE `' . $key . '` ' . $_condition . ' \'' . $value . '\' ORDER BY `' . $primary . '` DESC;';
$result = $this->connection->send($sql);
if (mysql_num_rows($result) < 0) {
throw new UndefinedRowException('undefined ' . $key . ' ' . $_condition . ' ' . $value);
}
$values = array();
while ($value = mysql_fetch_assoc($result)) {
$values[] = $value;
}
return $values;
}