Пример #1
0
 public function __construct(string $table, Connection $connection = null)
 {
     $this->table = $table;
     $this->connection = $connection ?? Connection::getConnection();
     if ($this->connection === null) {
         throw new \InvalidArgumentException('Could not establish connection to database');
     }
 }
Пример #2
0
 private function __construct()
 {
     $this->hydrator = new ConstructorlessHydrator();
     $this->connection = Connection::getConnection();
     $this->cache = new EntityCache();
 }
Пример #3
0
 public function __construct($ast, $ctx = null, Connection $connection = null)
 {
     $this->ast = $ast;
     $this->ctx = $ctx;
     $this->connection = $connection ?? Connection::getConnection();
 }