Enable Discovery debug logging for production troubleshooting
- Add DISCOVERY_LOG_LEVEL=debug - Add DISCOVERY_SHOW_PROGRESS=true - Temporary changes for debugging InitializerProcessor fixes on production
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Framework\Database\Criteria\Projection;
|
||||
|
||||
use App\Framework\Database\Criteria\Projection;
|
||||
|
||||
/**
|
||||
* List of multiple projections
|
||||
*/
|
||||
final readonly class ProjectionList implements Projection
|
||||
{
|
||||
/** @var Projection[] */
|
||||
public array $projections;
|
||||
|
||||
public function __construct(Projection ...$projections)
|
||||
{
|
||||
$this->projections = $projections;
|
||||
}
|
||||
|
||||
public function add(Projection $projection): self
|
||||
{
|
||||
$newProjections = [...$this->projections, $projection];
|
||||
|
||||
return new self(...$newProjections);
|
||||
}
|
||||
|
||||
public function toSql(): string
|
||||
{
|
||||
if (empty($this->projections)) {
|
||||
return '*';
|
||||
}
|
||||
|
||||
return implode(', ', array_map(fn ($p) => $p->toSql(), $this->projections));
|
||||
}
|
||||
|
||||
public function getAliases(): array
|
||||
{
|
||||
$aliases = [];
|
||||
foreach ($this->projections as $projection) {
|
||||
$aliases = array_merge($aliases, $projection->getAliases());
|
||||
}
|
||||
|
||||
return $aliases;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user