1616use function is_string ;
1717use function key ;
1818
19- /**
20- * Holds column definitions and renders the column list for SELECT statements.
21- * Includes both main table columns and join columns.
22- *
23- * Columns are normalized to ColumnRef[] at set time. Rendering is inlined
24- * with instanceof fast-paths for Identifier (hot path) and Literal (star).
25- */
2619class Columns extends AbstractPart
2720{
28- /** @var ColumnRef[] Normalized column references */
21+ /** @var ColumnRef[] */
2922 private array $ columnRefs = [];
30-
31- /** @var array Raw columns for getRawState() backward compatibility */
3223 private array $ rawColumns = [Select::SQL_STAR ];
33-
3424 private bool $ prefixColumnsWithTable = true ;
35-
36- /**
37- * Set during preparePartsForBuild -- the resolved table prefix (e.g. "table".)
38- */
3925 private string $ fromTablePrefix = '' ;
40-
41- /** @var JoinSpec[] Join specs for column resolution */
26+ /** @var JoinSpec[] */
4227 private array $ joinSpecs = [];
4328
4429 public function __construct ()
@@ -149,9 +134,6 @@ public function add(array|ExpressionInterface|string $column, ?string $alias = n
149134 return $ this ;
150135 }
151136
152- /**
153- * Reconstruct the original format for getRawState() compatibility.
154- */
155137 public function get (): array
156138 {
157139 return $ this ->rawColumns ;
@@ -168,29 +150,19 @@ public function getPrefixColumnsWithTable(): bool
168150 return $ this ->prefixColumnsWithTable ;
169151 }
170152
171- /**
172- * Set the table prefix for column resolution (e.g. "table".)
173- */
174153 public function setFromTablePrefix (string $ prefix ): static
175154 {
176155 $ this ->fromTablePrefix = $ prefix ;
177156 return $ this ;
178157 }
179158
180- /**
181- * Set join specs for column resolution during rendering.
182- *
183- * @param JoinSpec[] $specs
184- */
159+ /** @param JoinSpec[] $specs */
185160 public function setJoinSpecs (array $ specs ): static
186161 {
187162 $ this ->joinSpecs = $ specs ;
188163 return $ this ;
189164 }
190165
191- /**
192- * Normalize the raw columns array into ColumnRef[].
193- */
194166 private function normalizeColumns (): void
195167 {
196168 $ this ->columnRefs = [];
0 commit comments