|
5 | 5 | * for the Lean Mapper library (http://leanmapper.com) |
6 | 6 | * Copyright (c) 2013 Michal Bohuslávek |
7 | 7 | */ |
8 | | - |
9 | 8 | namespace LeanMapperQuery; |
10 | 9 |
|
11 | 10 | use LeanMapper; |
12 | | -use LeanMapper\Filtering; |
13 | | -use LeanMapper\Fluent; |
14 | | -use LeanMapper\Reflection\Property; |
15 | | -use LeanMapper\Relationship; |
16 | | -use LeanMapper\Result; |
17 | 11 | use LeanMapperQuery\Caller; |
18 | 12 | use LeanMapperQuery\Exception\InvalidArgumentException; |
19 | 13 | use LeanMapperQuery\Exception\InvalidMethodCallException; |
20 | 14 | use LeanMapperQuery\Exception\InvalidRelationshipException; |
21 | 15 | use LeanMapperQuery\Exception\InvalidStateException; |
22 | 16 | use LeanMapperQuery\Exception\MemberAccessException; |
23 | 17 | use LeanMapperQuery\IQuery; |
| 18 | +use LeanMapper\Filtering; |
| 19 | +use LeanMapper\Fluent; |
| 20 | +use LeanMapper\Reflection\Property; |
| 21 | +use LeanMapper\Relationship; |
| 22 | +use LeanMapper\Result; |
24 | 23 |
|
25 | 24 | /** |
26 | 25 | * @author Michal Bohuslávek |
@@ -83,7 +82,6 @@ public static function queryEntityProperty(LeanMapper\Entity $entity, $field, IQ |
83 | 82 | $targetTable = $relationship->getTargetTable(); |
84 | 83 | $referencingColumn = $relationship->getColumnReferencingSourceTable(); |
85 | 84 | $rows = $entity->row->referencing($targetTable, $referencingColumn, new Filtering($filters), $strategy); |
86 | | - |
87 | 85 | } elseif ($relationship instanceof Relationship\HasMany) { |
88 | 86 | $filters[] = function (Fluent $fluent) use ($mapper, $query) { |
89 | 87 | $query->applyQuery($fluent, $mapper, new QueryTarget\HasManyTargetTable); |
@@ -148,10 +146,8 @@ public function __call($name, array $arguments) |
148 | 146 | list(, $method, $field) = $matches; |
149 | 147 | $field = lcfirst($field); |
150 | 148 | return $this->$method($field, $query); |
151 | | - |
152 | 149 | } else { |
153 | 150 | return parent::__call($name, $arguments); |
154 | 151 | } |
155 | 152 | } |
156 | | - |
157 | 153 | } |
0 commit comments