Commit 57722d23 authored by Jens Segers's avatar Jens Segers

Tweak key conversion

parent 2dcb4595
...@@ -207,13 +207,12 @@ abstract class Model extends \Jenssegers\Eloquent\Model { ...@@ -207,13 +207,12 @@ abstract class Model extends \Jenssegers\Eloquent\Model {
// Convert _id to MongoId. // Convert _id to MongoId.
if ($key == '_id' and is_string($value)) if ($key == '_id' and is_string($value))
{ {
$this->attributes[$key] = new MongoId($value); $builder = $this->newBaseQueryBuilder();
$value = $builder->convertKey($value);
} }
else
{
parent::setAttribute($key, $value); parent::setAttribute($key, $value);
} }
}
/** /**
* Convert the model's attributes to an array. * Convert the model's attributes to an array.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment