0 follower

Final Class Yiisoft\Db\Profiler\Context\CommandContext

InheritanceYiisoft\Db\Profiler\Context\CommandContext » Yiisoft\Db\Profiler\Context\AbstractContext
ImplementsYiisoft\Db\Profiler\ContextInterface

Method Details

Hide inherited methods

__construct() public method

public mixed __construct ( string $method, string $logContext, string $sql, array $params )
$method string
$logContext string
$sql string
$params array

                public function __construct(
    private string $method,
    private string $logContext,
    private string $sql,
    private array $params,
) {
    parent::__construct($this->method);
}

            
asArray() public method

public array asArray ( )

                public function asArray(): array
{
    return parent::asArray() + [
        self::LOG_CONTEXT => $this->logContext,
        self::SQL => $this->sql,
        self::PARAMS => $this->params,
    ];
}

            
getType() public method

public string getType ( )

                public function getType(): string
{
    return 'command';
}

            
setException() public method
public Yiisoft\Db\Profiler\Context\CommandContext setException ( Throwable $e )
$e Throwable

                public function setException(Throwable $e): static
{
    $this->exception = $e;
    return $this;
}