Ejemplo n.º 1
0
 /**
  *
  * return a object to handle news items
  * from the news app
  *
  * @return mixed|null
  */
 private function getNewsApp()
 {
     /** @noinspection PhpUnnecessaryFullyQualifiedNameInspection */
     $app = new \OCA\News\AppInfo\Application();
     $container = $app->getContainer();
     $service = null;
     try {
         $service = $container->query('OCA\\News\\Service\\ItemService');
     } catch (\InvalidArgumentException $e) {
     }
     if (!$service) {
         $service = $container->query('ItemService');
     }
     return $service;
 }
Ejemplo n.º 2
0
<?php

/**
 * ownCloud - News
 *
 * This file is licensed under the Affero General Public License version 3 or
 * later. See the COPYING file.
 *
 * @author Bernhard Posselt <*****@*****.**>
 * @copyright Bernhard Posselt 2015
 */
$newsApp = new OCA\News\AppInfo\Application();
$newsContainer = $newsApp->getContainer();
$newsCmd = $newsContainer->query('OCA\\News\\Command\\GenerateSearchIndices');
$application->add($newsCmd);
Ejemplo n.º 3
0
    private function getNewsapi() {

        $app = null;
        if (class_exists('\OCA\News\App\News')) {
            $app = new \OCA\News\App\News();
        } elseif (class_exists('\OCA\News\AppInfo\Application')) {
            $app = new \OCA\News\AppInfo\Application();
        }

        if( $app ) {
            $container = $app->getContainer();
            $this->itembusinesslayer = $container->query('ItemBusinessLayer');
        }
    }