Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixup! Introduce Doctrine ORM
  • Loading branch information
CarlSchwan committed Aug 24, 2022
commit f2e5d723d284b614c53a2d8d04cc0828a7ac428d
4 changes: 4 additions & 0 deletions lib/private/DB/ORM/EntityManagerAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ public function __construct(ConnectionAdapter $connection) {
$this->connection = $connection;
}

public function createQueryBuilder(): IQueryBuilder {
return new QueryBuilderAdapter($this->em->createQueryBuilder());
}

public function createQuery($dql = ''): IQuery
{
return new QueryAdapter($this->em->createQuery($dql));
Expand Down
25 changes: 25 additions & 0 deletions lib/private/DB/ORM/ExpressionAdapter.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

declare(strict_types=1);

// SPDX-FileCopyrightText: Carl Schwan <[email protected]>
// SPDX-License-Identifier: AGPL-3.0-or-later

namespace OC\DB\ORM;

use Doctrine\Common\EventManager;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\ORMSetup;
use Doctrine\ORM\Query\Expr;
use OC\DB\ConnectionAdapter;
use OCP\DB\ORM\Query\IExpression;
use OCP\IDBConnection;

class ExpressionAdapter implements IExpression {
private Expr $expr;

public function __construct(Expr $expr) {
$this->expr = $expr;
}
}
Loading