Permalink
Browse files

Add ClassMetadata#getIdentifierValues()

  • Loading branch information...
beberlei committed Nov 26, 2011
1 parent bf750d4 commit 86790b3ebbf1083116a4b8e90fbaa8f8ba9052d8
@@ -286,6 +286,21 @@ public function getIdentifierValue($document)
{
return (string) $this->reflFields[$this->identifier]->getValue($document);
}
+
+ /**
+ * Get identifier values of this document.
+ *
+ * Since CouchDB only allows exactly one identifier field this is a proxy
+ * to {@see getIdentifierValue()} and returns an array with the identifier
+ * field as a key.
+ *
+ * @param object $document
+ * @return array
+ */
+ public function getIdentifierValues($document)
+ {
+ return array($this->identifier => $this->getIdentifierValue($document));
+ }
/**
* Sets the specified field to the specified value on the given document.
No changes.

0 comments on commit 86790b3

Please sign in to comment.