File tree Expand file tree Collapse file tree 2 files changed +48
-0
lines changed Expand file tree Collapse file tree 2 files changed +48
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ namespace Doctrine \ORM \Query \Exec ;
6+
7+ use Doctrine \ORM \Query ;
8+
9+ /**
10+ * SqlFinalizers are created by OutputWalkers that traversed the DQL AST.
11+ * The SqlFinalizer instance can be kept in the query cache and re-used
12+ * at a later time.
13+ *
14+ * Once the SqlFinalizer has been created or retrieved from the query cache,
15+ * it receives the Query object again in order to yield the AbstractSqlExecutor
16+ * that will then be used to execute the query.
17+ *
18+ * The SqlFinalizer may assume that the DQL that was used to build the AST
19+ * and run the OutputWalker (which created the SqlFinalizer) is equivalent to
20+ * the query that will be passed to the createExecutor() method. Potential differences
21+ * are the parameter values or firstResult/maxResult settings.
22+ */
23+ interface SqlFinalizer
24+ {
25+ public function createExecutor (Query $ query ): AbstractSqlExecutor ;
26+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ namespace Doctrine \ORM \Query ;
6+
7+ use Doctrine \ORM \Query \Exec \SqlFinalizer ;
8+
9+ /**
10+ * Interface for output walkers
11+ *
12+ * Output walkers, like tree walkers, can traverse the DQL AST to perform
13+ * their purpose.
14+ *
15+ * The goal of an OutputWalker is to ultimately provide the SqlFinalizer
16+ * which produces the final, executable SQL statement in a "finalization" phase.
17+ */
18+ interface OutputWalker extends TreeWalker
19+ {
20+ /** @param AST\DeleteStatement|AST\UpdateStatement|AST\SelectStatement $AST */
21+ public function getFinalizer ($ AST ): SqlFinalizer ;
22+ }
You can’t perform that action at this time.
0 commit comments