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 __construct( string $method, string $logContext, string $sql, array $params ): mixed
$method string
$logContext string
$sql string
$params array

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

            
asArray() public method

public asArray( ): array

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

            
getType() public method

public getType( ): string

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

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

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