Skip to content

Commit

Permalink
Make test pass.
Browse files Browse the repository at this point in the history
  • Loading branch information
lukemorton committed Aug 8, 2012
1 parent 133e7f2 commit efcf864
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion classes/TheCure/Mappers/MongoMapper.php
Expand Up @@ -30,7 +30,21 @@ abstract class MongoMapper extends Mapper implements ConnectionSetGet {

protected function idize($id)
{
if ( ! $id instanceOf MongoID)
if (is_array($id))
{
$first_value = current($id);
$first_key = key($id);

if (is_array($first_value))
{
foreach ($first_value as $_k => $_id)
{
$id[$first_key][$_k] = $this->idize($_id);
}
}
}

elseif ( ! $id instanceOf MongoID)
{
$id = new MongoID($id);
}
Expand Down

0 comments on commit efcf864

Please sign in to comment.