-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCommandInterface.php
More file actions
68 lines (61 loc) · 1.67 KB
/
Copy pathCommandInterface.php
File metadata and controls
68 lines (61 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?php
namespace Bdf\Prime\Query;
use Bdf\Prime\Connection\ConnectionInterface;
use Bdf\Prime\Connection\Result\ResultSetInterface;
use Bdf\Prime\Exception\PrimeException;
use Bdf\Prime\Query\Compiler\CompilerInterface;
use Bdf\Prime\Query\Contract\SelfExecutable;
/**
* Base type for perform an SGBD command
*
* @template C as ConnectionInterface
*/
interface CommandInterface extends CompilableClauseInterface, SelfExecutable
{
/**
* Gets the query language compiler
*
* @return object
*/
public function compiler(): object;
/**
* Gets the associated DBAL Connection for this command
*
* @return C
*/
public function connection(): ConnectionInterface;
/**
* Set connection
*
* @param C $connection
*
* @return $this
*/
public function on(ConnectionInterface $connection);
/**
* {@inheritdoc}
*
* @param string|array $columns Filter result columns
*
* @return ResultSetInterface<array<string, mixed>>
* @throws PrimeException When execute fail
*/
public function execute($columns = null): ResultSetInterface;
/**
* Creates and adds a query root corresponding to the table identified by the
* given alias, forming a cartesian product with any existing query roots.
*
* <code>
* $query
* ->select('u.id')
* ->from('users', 'u')
* ->from('customers', 'c');
* </code>
*
* @param string $from The table.
* @param string|null $alias The alias of the table.
*
* @return $this This Query instance.
*/
public function from(string $from, ?string $alias = null);
}