Commit 58f4af0f authored by Eric Tucker's avatar Eric Tucker

Styleci updates

parent fe3dac7d
......@@ -157,9 +157,11 @@ class Builder extends EloquentBuilder
elseif ($results instanceof BSONDocument) {
$results = $results->getArrayCopy();
return $this->model->newFromBuilder((array)$results);
} // The result is a single object.
elseif (is_array($results) and array_key_exists('_id', $results)) {
return $this->model->newFromBuilder((array)$results);
}
......
......@@ -7,4 +7,5 @@ use Illuminate\Database\Eloquent\Builder;
class EloquentBuilder extends Builder
{
use QueriesRelationships;
}
\ No newline at end of file
......@@ -138,6 +138,7 @@ trait QueriesRelationships
protected function getConstrainedRelatedIds($relations, $operator, $count)
{
$relationCount = array_count_values(array_map(function ($id) {
return (string)$id; // Convert Back ObjectIds to Strings
}, is_array($relations) ? $relations : $relations->flatten()->toArray()));
// Remove unwanted related objects based on the operator and count.
......@@ -162,4 +163,5 @@ trait QueriesRelationships
// All related ids.
return array_keys($relationCount);
}
}
\ No newline at end of file
......@@ -75,7 +75,6 @@ class HybridRelationsTest extends TestCase
$this->assertEquals('John Doe', $role->user->name);
}
public function testHybridWhereHas()
{
$user = new MysqlUser;
......
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