Skip to content

Commit

Permalink
Update docs refs #4962
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Oct 24, 2014
1 parent f78a238 commit 1f3fa57
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/Database/Query.php
Expand Up @@ -230,15 +230,19 @@ public function traverse(callable $visitor, array $parts = []) {
* By default this function will append any passed argument to the list of fields
* to be selected, unless the second argument is set to true.
*
* ##Examples:
* ## Examples:
*
* {{{
* $query->select(['id', 'title']); // Produces SELECT id, title
* $query->select(['author' => 'author_id']); // Appends author: SELECT id, title, author_id as author
* $query->select('id', true); // Resets the list: SELECT id
* $query->select(['total' => $countQuery]); // SELECT id, (SELECT ...) AS total
* $query->select(['id', 'title']); // Produces SELECT id, title
* $query->select(['author' => 'author_id']); // Appends author: SELECT id, title, author_id as author
* $query->select('id', true); // Resets the list: SELECT id
* $query->select(['total' => $countQuery]); // SELECT id, (SELECT ...) AS total
* }}}
*
* By default no fields are selected, if you have an instance of `Cake\ORM\Query` and try to append
* fields you should also call `Cake\ORM\Query::autoFields()` to select the default fields
* from the table.
*
* @param array|ExpressionInterface|string $fields fields to be added to the list
* @param bool $overwrite whether to reset fields with passed list or not
* @return $this
Expand Down

0 comments on commit 1f3fa57

Please sign in to comment.