-
-
Notifications
You must be signed in to change notification settings - Fork 114
Expand file tree
/
Copy pathCallStatement.php
More file actions
36 lines (30 loc) · 683 Bytes
/
CallStatement.php
File metadata and controls
36 lines (30 loc) · 683 Bytes
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
<?php
declare(strict_types=1);
namespace PhpMyAdmin\SqlParser\Statements;
use PhpMyAdmin\SqlParser\Components\FunctionCall;
use PhpMyAdmin\SqlParser\Statement;
use function implode;
/**
* `CALL` statement.
*
* CALL sp_name([parameter[,...]])
*
* or
*
* CALL sp_name[()]
*/
class CallStatement extends Statement
{
/**
* The name of the function and its parameters.
*/
public FunctionCall|null $call = null;
/**
* Build statement for CALL.
*/
public function build(): string
{
return 'CALL ' . $this->call->name . '('
. ($this->call->parameters ? implode(',', $this->call->parameters->raw) : '') . ')';
}
}