Skip to content
This repository was archived by the owner on Feb 5, 2024. It is now read-only.

Adding keys parameter in View Query #3

Merged
merged 1 commit into from
Aug 17, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion lib/Doctrine/CouchDB/View/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,30 @@ protected function getHttpQuery()
/**
* Find key in view.
*
* @param string $val
* @param string|array $val
* @return Query
*/
public function setKey($val)
{
if (is_array($val)) {
return $this->setKeys($val);
}
$this->params['key'] = $val;
return $this;
}

/**
* Find keys in the view
*
* @param array $values
* @return Query
*/
public function setKeys(array $values)
{
$this->params['keys'] = $values;
return $this;
}

/**
* Set starting key to query view for.
*
Expand Down