Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class MyModel extends Nette\Object
- {
- /** @var DibiConnection */
- private $db;
- public function __construct(DibiConnection $db)
- {
- $this->db;
- }
- public function find()
- {
- $this->db->query('select * from ...');
- // ...
- }
- }
- // v configu
- services:
- my:
- class: MyModel
- arguments: [@connection]
- // nebo v presenteru
- $this->model = new MyModel($this->context->connection);
Advertisement
Add Comment
Please, Sign In to add comment