本文整理匯總了PHP中Argument::setColumnOperation方法的典型用法代碼示例。如果您正苦於以下問題:PHP Argument::setColumnOperation方法的具體用法?PHP Argument::setColumnOperation怎麽用?PHP Argument::setColumnOperation使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Argument
的用法示例。
在下文中一共展示了Argument::setColumnOperation方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getClickCountQuery
/**
* Given a SELECT statement that uses click count
* returns the corresponding update sql string
* for databases that don't have click count support built in
* (aka all besides CUBRID)
*
* Function does not check if click count columns exist!
* You must call $query->usesClickCount() before using this function
*
* @param $queryObject
*/
function getClickCountQuery($queryObject)
{
$new_update_columns = array();
$click_count_columns = $queryObject->getClickCountColumns();
foreach ($click_count_columns as $click_count_column) {
$click_count_column_name = $click_count_column->column_name;
$increase_by_1 = new Argument($click_count_column_name, null);
$increase_by_1->setColumnOperation('+');
$increase_by_1->ensureDefaultValue(1);
$update_expression = new UpdateExpression($click_count_column_name, $increase_by_1);
$new_update_columns[] = $update_expression;
}
$queryObject->columns = $new_update_columns;
return $queryObject;
}