本文整理汇总了PHP中Cake\Database\Query::epilog方法的典型用法代码示例。如果您正苦于以下问题:PHP Query::epilog方法的具体用法?PHP Query::epilog怎么用?PHP Query::epilog使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cake\Database\Query
的用法示例。
在下文中一共展示了Query::epilog方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _insertQueryTranslator
/**
* Modifies the original insert query to append a "RETURNING *" epilogue
* so that the latest insert id can be retrieved
*
* @param \Cake\Database\Query $query The query to translate.
* @return \Cake\Database\Query
*/
protected function _insertQueryTranslator($query)
{
if (!$query->clause('epilog')) {
$query->epilog('RETURNING *');
}
return $query;
}
示例2: _buildLimitPart
/**
* Generates the LIMIT part of a SQL query
*
* @param int $limit the limit clause
* @param \Cake\Database\Query $query The query that is being compiled
* @return string
*/
protected function _buildLimitPart($limit, $query)
{
if (intval($limit) < 1) {
return '';
}
$endRow = intval($query->clause('offset')) + $limit;
$origEpilog = $query->clause('epilog');
$offsetEndWrap = '';
if (is_array($origEpilog) && array_key_exists('snelgOracleOrigEpilog', $origEpilog)) {
$offsetEndWrap = empty($origEpilog['snelgOracleOffsetEndWrap']) ? '' : $origEpilog['snelgOracleOffsetEndWrap'];
$origEpilog = $origEpilog['snelgOracleOrigEpilog'];
}
//See note in _buildOffsetPart about ->bind being potentially
//more efficient here
$query->epilog(['snelgOracleOrigEpilog' => $origEpilog, 'snelgOracleLimitEndWrap' => ") a WHERE ROWNUM <= {$endRow}", 'snelgOracleOffsetEndWrap' => $offsetEndWrap]);
return 'SELECT /*+ FIRST_ROWS(n) */ a.*, ROWNUM snelg_oracle_sub_rnum FROM (';
}