@@ -4,12 +4,8 @@ |
||
4 | 4 | |
5 | 5 | use Illuminate\Http\Request; |
6 | 6 | use Illuminate\Http\Response; |
7 | - |
|
8 | -use App\Http\Requests; |
|
9 | 7 | use App\Http\Controllers\Controller; |
10 | 8 | use Illuminate\Support\Facades\App; |
11 | -use Illuminate\Foundation\Application; |
|
12 | - |
|
13 | 9 | use POData\OperationContext\ServiceHost as ServiceHost; |
14 | 10 | use POData\SimpleDataService as DataService; |
15 | 11 | use POData\OperationContext\Web\Illuminate\IlluminateOperationContext as OperationContextAdapter; |
@@ -1,26 +1,12 @@ |
||
1 | 1 | <?php |
2 | 2 | namespace AlgoWeb\PODataLaravel\Models; |
3 | 3 | |
4 | -use Doctrine\DBAL\Exception\InvalidArgumentException; |
|
5 | 4 | use Illuminate\Support\Facades\Schema; |
6 | 5 | use Illuminate\Support\Facades\DB; |
7 | 6 | use Illuminate\Support\Facades\App; |
8 | -use Illuminate\Support\Str; |
|
9 | 7 | use Illuminate\Database\Eloquent\Relations\Relation; |
10 | - |
|
11 | 8 | use POData\Providers\Metadata\ResourceStreamInfo; |
12 | -use POData\Providers\Metadata\ResourceAssociationSetEnd; |
|
13 | -use POData\Providers\Metadata\ResourceAssociationSet; |
|
14 | -use POData\Common\NotImplementedException; |
|
15 | 9 | use POData\Providers\Metadata\Type\EdmPrimitiveType; |
16 | -use POData\Providers\Metadata\ResourceSet; |
|
17 | -use POData\Providers\Metadata\ResourcePropertyKind; |
|
18 | -use POData\Providers\Metadata\ResourceProperty; |
|
19 | -use POData\Providers\Metadata\ResourceTypeKind; |
|
20 | -use POData\Providers\Metadata\ResourceType; |
|
21 | -use POData\Common\InvalidOperationException; |
|
22 | -use POData\Providers\Metadata\IMetadataProvider; |
|
23 | -use POData\Providers\Metadata\SimpleMetadataProvider; |
|
24 | 10 | use Illuminate\Database\Eloquent\Model; |
25 | 11 | |
26 | 12 | trait MetadataTrait |
@@ -229,16 +229,16 @@ |
||
229 | 229 | $begin = strpos($code, 'function('); |
230 | 230 | $code = substr($code, $begin, strrpos($code, '}') - $begin + 1); |
231 | 231 | foreach (array( |
232 | - 'hasMany', |
|
233 | - 'hasManyThrough', |
|
234 | - 'belongsToMany', |
|
235 | - 'hasOne', |
|
236 | - 'belongsTo', |
|
237 | - 'morphOne', |
|
238 | - 'morphTo', |
|
239 | - 'morphMany', |
|
240 | - 'morphToMany' |
|
241 | - ) as $relation) { |
|
232 | + 'hasMany', |
|
233 | + 'hasManyThrough', |
|
234 | + 'belongsToMany', |
|
235 | + 'hasOne', |
|
236 | + 'belongsTo', |
|
237 | + 'morphOne', |
|
238 | + 'morphTo', |
|
239 | + 'morphMany', |
|
240 | + 'morphToMany' |
|
241 | + ) as $relation) { |
|
242 | 242 | $search = '$this->' . $relation . '('; |
243 | 243 | if ($pos = stripos($code, $search)) { |
244 | 244 | //Resolve the relation's model to a Relation object. |
@@ -9,7 +9,6 @@ |
||
9 | 9 | use POData\UriProcessor\QueryProcessor\ExpressionParser\Expressions\PropertyAccessExpression; |
10 | 10 | use POData\UriProcessor\QueryProcessor\FunctionDescription; |
11 | 11 | use POData\Providers\Expression\IExpressionProvider; |
12 | -use Illuminate\Support\Str; |
|
13 | 12 | |
14 | 13 | class LaravelExpressionProvider implements IExpressionProvider |
15 | 14 | { |
@@ -285,7 +285,7 @@ |
||
285 | 285 | .' ' . $str[1] . self::CLOSE_BRACKET; |
286 | 286 | } |
287 | 287 | //return self::OPEN_BRACKET . $left . ' ' . $operator . ' ' . $right . self::CLOSE_BRACKET; |
288 | - return $this->getSql(); |
|
288 | + return $this->getSql(); |
|
289 | 289 | } |
290 | 290 | /** |
291 | 291 | * To format unary expression. |
@@ -25,7 +25,7 @@ |
||
25 | 25 | public function register() |
26 | 26 | { |
27 | 27 | $this->app->singleton('odataquery', function ($app) { |
28 | - return new LaravelQuery(); |
|
28 | + return new LaravelQuery(); |
|
29 | 29 | }); |
30 | 30 | } |
31 | 31 | } |