Allow to inject ISearchResult

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2018-04-26 12:19:15 +02:00
parent b7e8ab97e7
commit f5b143e318
No known key found for this signature in database
GPG Key ID: 7076EA9751AACDDA
1 changed files with 4 additions and 1 deletions

View File

@ -46,6 +46,7 @@ use OC\AppFramework\Middleware\Security\RateLimitingMiddleware;
use OC\AppFramework\Middleware\Security\SecurityMiddleware; use OC\AppFramework\Middleware\Security\SecurityMiddleware;
use OC\AppFramework\Middleware\SessionMiddleware; use OC\AppFramework\Middleware\SessionMiddleware;
use OC\AppFramework\Utility\SimpleContainer; use OC\AppFramework\Utility\SimpleContainer;
use OC\Collaboration\Collaborators\SearchResult;
use OC\Core\Middleware\TwoFactorMiddleware; use OC\Core\Middleware\TwoFactorMiddleware;
use OC\RichObjectStrings\Validator; use OC\RichObjectStrings\Validator;
use OC\ServerContainer; use OC\ServerContainer;
@ -53,6 +54,7 @@ use OCP\AppFramework\Http\IOutput;
use OCP\AppFramework\IAppContainer; use OCP\AppFramework\IAppContainer;
use OCP\AppFramework\QueryException; use OCP\AppFramework\QueryException;
use OCP\AppFramework\Utility\ITimeFactory; use OCP\AppFramework\Utility\ITimeFactory;
use OCP\Collaboration\Collaborators\ISearchResult;
use OCP\Files\Folder; use OCP\Files\Folder;
use OCP\Files\IAppData; use OCP\Files\IAppData;
use OCP\GlobalScale\IConfig; use OCP\GlobalScale\IConfig;
@ -62,7 +64,6 @@ use OCP\IRequest;
use OCP\IServerContainer; use OCP\IServerContainer;
use OCP\IUserSession; use OCP\IUserSession;
use OCP\RichObjectStrings\IValidator; use OCP\RichObjectStrings\IValidator;
use OCP\Util;
use OCP\Encryption\IManager; use OCP\Encryption\IManager;
use OCA\WorkflowEngine\Manager; use OCA\WorkflowEngine\Manager;
@ -144,6 +145,8 @@ class DIContainer extends SimpleContainer implements IAppContainer {
return $c; return $c;
}); });
$this->registerAlias(ISearchResult::class, SearchResult::class);
// commonly used attributes // commonly used attributes
$this->registerService('UserId', function ($c) { $this->registerService('UserId', function ($c) {
return $c->query(IUserSession::class)->getSession()->get('user_id'); return $c->query(IUserSession::class)->getSession()->get('user_id');