-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add capability to use allfields sql notation
in a dto, this PR allow to call u.* to get all fileds fo u entity in one call,
- Loading branch information
Showing
7 changed files
with
510 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Doctrine\ORM\Query\AST; | ||
|
||
use Doctrine\ORM\Query\SqlWalker; | ||
|
||
/** | ||
* AllFieldsExpression ::= u.* | ||
* | ||
* @link www.doctrine-project.org | ||
*/ | ||
class AllFieldsExpression extends Node | ||
{ | ||
public string $field = 'fakefield'; | ||
|
||
public function __construct( | ||
public string|null $identificationVariable, | ||
) { | ||
} | ||
|
||
public function dispatch(SqlWalker $walker, int|string $parent = '', int|string $argIndex = '', int|null &$aliasGap = null): string | ||
{ | ||
return $walker->walkAllEntityFieldsExpression($this, $parent, $argIndex, $aliasGap); | ||
} | ||
} |
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,22 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Doctrine\Tests\Models\CMS; | ||
|
||
class CmsDumbVariadicDTO | ||
{ | ||
private array $values = []; | ||
|
||
public function __construct(...$args) | ||
{ | ||
foreach ($args as $key => $val) { | ||
$this->values[$key] = $val; | ||
} | ||
} | ||
|
||
public function __get(string $key): mixed | ||
{ | ||
return $this->values[$key] ?? null; | ||
} | ||
} |
Oops, something went wrong.