Cake\Database\Query::epilog PHP Method

epilog() public method

### Examples: $query->select('id')->where(['author_id' => 1])->epilog('FOR UPDATE'); $query ->insert('articles', ['title']) ->values(['author_id' => 1]) ->epilog('RETURNING id');
public epilog ( string | Cake\Database\Expression\QueryExpression | null $expression = null )
$expression string | Cake\Database\Expression\QueryExpression | null The expression to be appended
    public function epilog($expression = null)
    {
        $this->_dirty();
        $this->_parts['epilog'] = $expression;
        return $this;
    }

Usage Example

 /**
  * 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;
 }
All Usage Examples Of Cake\Database\Query::epilog