-
-
Notifications
You must be signed in to change notification settings - Fork 845
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(doctrine): stateOptions can handleLinks for query optimization
- Loading branch information
Showing
21 changed files
with
378 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the API Platform project. | ||
* | ||
* (c) Kévin Dunglas <dunglas@gmail.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace ApiPlatform\Doctrine\Odm\State; | ||
|
||
use ApiPlatform\State\OptionsInterface; | ||
|
||
class Options implements OptionsInterface | ||
{ | ||
/** | ||
* @param mixed $handleLinks experimental callable, typed mixed as we may want a service name in the future | ||
*/ | ||
public function __construct( | ||
protected ?string $entityClass = null, | ||
/** | ||
* static function handleLinks(Doctrine\ODM\MongoDB\Aggregation\Builder $aggregationBuilder, array $identifiers, array $context, string $resourceClass, ApiPlatform\Metadata\Operation $operation): void. | ||
*/ | ||
protected mixed $handleLinks = null, | ||
) { | ||
} | ||
|
||
public function getEntityClass(): ?string | ||
{ | ||
return $this->entityClass; | ||
} | ||
|
||
public function withEntityClass(?string $entityClass): self | ||
{ | ||
$self = clone $this; | ||
$self->entityClass = $entityClass; | ||
|
||
return $self; | ||
} | ||
|
||
public function getHandleLinks(): mixed | ||
{ | ||
return $this->handleLinks; | ||
} | ||
|
||
public function withHandleLinks(mixed $handleLinks): self | ||
{ | ||
$self = clone $this; | ||
$self->handleLinks = $handleLinks; | ||
|
||
return $self; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.