Final Class Yiisoft\Db\Oracle\Connection
| Inheritance | Yiisoft\Db\Oracle\Connection » Yiisoft\Db\Driver\Pdo\AbstractPdoConnection |
|---|
Implements a connection to a database via PDO (PHP Data Objects) for Oracle Server.
Public Methods
| Method | Description | Defined By |
|---|---|---|
| createCommand() | Yiisoft\Db\Oracle\Connection | |
| createTransaction() | Yiisoft\Db\Oracle\Connection | |
| getColumnBuilderClass() | Yiisoft\Db\Oracle\Connection | |
| getColumnFactory() | Yiisoft\Db\Oracle\Connection | |
| getLastInsertId() | Override base behaviour to support Oracle sequences. | Yiisoft\Db\Oracle\Connection |
| getQueryBuilder() | Yiisoft\Db\Oracle\Connection | |
| getQuoter() | Yiisoft\Db\Oracle\Connection | |
| getSchema() | Yiisoft\Db\Oracle\Connection | |
| getServerInfo() | Yiisoft\Db\Oracle\Connection |
Method Details
| public \Yiisoft\Db\Driver\Pdo\PdoCommandInterface createCommand ( string|null $sql = null, array $params = [] ) | ||
| $sql | string|null | |
| $params | array | |
public function createCommand(?string $sql = null, array $params = []): PdoCommandInterface
{
$command = new Command($this);
if ($sql !== null) {
$command->setSql($sql);
}
if ($this->logger !== null) {
$command->setLogger($this->logger);
}
if ($this->profiler !== null) {
$command->setProfiler($this->profiler);
}
return $command->bindValues($params);
}
| public \Yiisoft\Db\Transaction\TransactionInterface createTransaction ( ) |
public function createTransaction(): TransactionInterface
{
return new Transaction($this);
}
| public string getColumnBuilderClass ( ) |
public function getColumnBuilderClass(): string
{
return ColumnBuilder::class;
}
| public \Yiisoft\Db\Schema\Column\ColumnFactoryInterface getColumnFactory ( ) |
public function getColumnFactory(): ColumnFactoryInterface
{
return $this->columnFactory ??= new ColumnFactory();
}
Override base behaviour to support Oracle sequences.
| public string getLastInsertId ( string|null $sequenceName = null ) | ||
| $sequenceName | string|null | |
| throws | \Yiisoft\Db\Exception\Exception | |
|---|---|---|
| throws | \Yiisoft\Db\Exception\InvalidConfigException | |
| throws | \Yiisoft\Db\Exception\InvalidCallException | |
| throws | Throwable | |
public function getLastInsertId(?string $sequenceName = null): string
{
if ($sequenceName === null) {
throw new InvalidArgumentException('Oracle not support lastInsertId without sequence name.');
}
if ($this->isActive()) {
// get the last insert id from connection
$sequenceName = $this->getQuoter()->quoteSimpleTableName($sequenceName);
return (string) $this->createCommand("SELECT $sequenceName.CURRVAL FROM DUAL")->queryScalar();
}
throw new InvalidCallException('DB Connection is not active.');
}
| public \Yiisoft\Db\QueryBuilder\QueryBuilderInterface getQueryBuilder ( ) |
public function getQueryBuilder(): QueryBuilderInterface
{
return $this->queryBuilder ??= new QueryBuilder($this);
}
| public \Yiisoft\Db\Schema\QuoterInterface getQuoter ( ) |
public function getQuoter(): QuoterInterface
{
return $this->quoter ??= new Quoter('"', '"', $this->getTablePrefix());
}
| public \Yiisoft\Db\Schema\SchemaInterface getSchema ( ) |
public function getSchema(): SchemaInterface
{
return $this->schema ??= new Schema($this, $this->schemaCache, strtoupper($this->driver->getUsername()));
}
| public \Yiisoft\Db\Connection\ServerInfoInterface getServerInfo ( ) |
public function getServerInfo(): ServerInfoInterface
{
return $this->serverInfo ??= new ServerInfo($this);
}
Signup or Login in order to comment.