Skip to content

Commit

Permalink
Update define-connection.md (#374)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerych1984 authored Jul 4, 2024
1 parent d01f2d5 commit c8d7a5e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/define-connection.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,15 @@ final class Register
Another way to define the DB connection for Active Record is to use dependency injection.

```php
use Psr\Container\ContainerInterface;
use Yiisoft\Db\Connection\ConnectionInterface;

class User extends ActiveRecord
{
public function __construct(private ContainerInterface $db)
public function __construct(private readonly ConnectionInterface $db)
{
}

public function db(): ContainerInterface
public function db(): ConnectionInterface
{
return $this->db;
}
Expand Down

0 comments on commit c8d7a5e

Please sign in to comment.