Skip to content

Commit

Permalink
Update OCP
Browse files Browse the repository at this point in the history
  • Loading branch information
nextcloud-command committed Jun 28, 2024
1 parent ed68686 commit 6a23d33
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
21 changes: 21 additions & 0 deletions OCP/AppFramework/Db/QBMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*/
namespace OCP\AppFramework\Db;

use Generator;
use OCP\DB\Exception;
use OCP\DB\QueryBuilder\IQueryBuilder;
use OCP\IDBConnection;
Expand Down Expand Up @@ -321,6 +322,26 @@ protected function findEntities(IQueryBuilder $query): array {
}
}

/**
* Runs a sql query and yields each resulting entity to obtain database entries in a memory-efficient way
*
* @param IQueryBuilder $query
* @return Generator Generator of fetched entities
* @psalm-return Generator<T> Generator of fetched entities
* @throws Exception
* @since 30.0.0
*/
protected function yieldEntities(IQueryBuilder $query): Generator {
$result = $query->executeQuery();
try {
while ($row = $result->fetch()) {
yield $this->mapRowToEntity($row);
}
} finally {
$result->closeCursor();
}
}


/**
* Returns an db result and throws exceptions when there are more or less
Expand Down
2 changes: 2 additions & 0 deletions OCP/Comments/ICommentsEventHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@
* Interface ICommentsEventHandler
*
* @since 11.0.0
* @deprecated 30.0.0 Register a listener for the CommentsEvent through the IEventDispatcher
*/
interface ICommentsEventHandler {
/**
* @param CommentsEvent $event
* @since 11.0.0
* @deprecated 30.0.0 Register a listener for the CommentsEvent through the IEventDispatcher
*/
public function handle(CommentsEvent $event);
}
4 changes: 3 additions & 1 deletion OCP/Federation/ICloudIdManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,11 @@ public function isValidCloudId(string $cloudId): bool;
* remove scheme/protocol from an url
*
* @param string $url
* @param bool $httpsOnly
*
* @return string
* @since 28.0.0
* @since 30.0.0 - Optional parameter $httpsOnly was added
*/
public function removeProtocolFromUrl(string $url): string;
public function removeProtocolFromUrl(string $url, bool $httpsOnly = false): string;
}

0 comments on commit 6a23d33

Please sign in to comment.