diff options
Diffstat (limited to 'lib/Service/ItemService.php')
-rw-r--r-- | lib/Service/ItemService.php | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/lib/Service/ItemService.php b/lib/Service/ItemService.php index 5e1660cc0..3a0270658 100644 --- a/lib/Service/ItemService.php +++ b/lib/Service/ItemService.php @@ -15,13 +15,22 @@ namespace OCA\News\Service; use OCA\News\AppInfo\Application; use OCA\News\Db\Item; +use OCA\News\Service\Exceptions\ServiceNotFoundException; +use OCP\AppFramework\Db\Entity; use OCP\IConfig; use OCP\AppFramework\Db\DoesNotExistException; use OCA\News\Db\ItemMapper; use OCA\News\Db\FeedType; use OCA\News\Utility\Time; +use Psr\Log\LoggerInterface; +/** + * Class LegacyItemService + * + * @package OCA\News\Service + * @deprecated use ItemServiceV2 + */ class ItemService extends Service { @@ -32,12 +41,13 @@ class ItemService extends Service public function __construct( ItemMapper $itemMapper, Time $timeFactory, - IConfig $config + IConfig $config, + LoggerInterface $logger ) { - parent::__construct($itemMapper); + parent::__construct($itemMapper, $logger); + $this->config = $config; $this->timeFactory = $timeFactory; $this->itemMapper = $itemMapper; - $this->config = $config; } @@ -96,7 +106,7 @@ class ItemService extends Service * or body * @return array of items */ - public function findAll( + public function findAllItems( $id, $type, $limit, @@ -128,7 +138,7 @@ class ItemService extends Service $search ); default: - return $this->itemMapper->findAll( + return $this->itemMapper->findAllItems( $limit, $offset, $type, @@ -140,6 +150,11 @@ class ItemService extends Service } } + public function findAllForUser(string $userId): array + { + return $this->itemMapper->findAllFromUser($userId); + } + /** * Star or unstar an item @@ -320,4 +335,9 @@ class ItemService extends Service { $this->itemMapper->updateSearchIndices(); } + + public function findAll(): array + { + return $this->mapper->findAll(); + } } |