Open
Description
There appears to be logic DocumentRepository::find()
to support passing a document as the $id
parameter and unwrapping the identifier field value.
public function find($id, $lockMode = LockMode::NONE, $lockVersion = null)
{
// ...
/* TODO: What if the ID object has a field with the same name as the
* class' mapped identifier field name?
*/
if (is_array($id)) {
list($identifierFieldName) = $this->class->getIdentifierFieldNames();
if (isset($id[$identifierFieldName])) {
$id = $id[$identifierFieldName];
}
None of the tests in ODM depend on this functionality; however, some userland code may be. Consider removing this in 2.0.