CoreFiles by mySites.guru
newsfeeds.php54 lines, 1,254 bytes, from Joomla_4.2.0-Stable-Full_Package.zip
Raw History Compare with 4.1.5
md5
973e05acd146b598862267073c2a6b28
sha1
ffae5ed40b7f0c8b9e33261dce2a84d4b637d394
sha256
94a7055e687ad1ba26700295e6ddc2cef34644408714a71000d39b9abca08bce
<?php

/**
 * @package     Joomla.Plugin
 * @subpackage  Webservices.Newsfeeds
 *
 * @copyright   (C) 2019 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt

 * @phpcs:disable PSR1.Classes.ClassDeclaration.MissingNamespace
 */

use Joomla\CMS\Plugin\CMSPlugin;
use Joomla\CMS\Router\ApiRouter;

/**
 * Web Services adapter for com_newsfeeds.
 *
 * @since  4.0.0
 */
class PlgWebservicesNewsfeeds extends CMSPlugin
{
    /**
     * Load the language file on instantiation.
     *
     * @var    boolean
     * @since  4.0.0
     */
    protected $autoloadLanguage = true;

    /**
     * Registers com_newsfeeds's API's routes in the application
     *
     * @param   ApiRouter  &$router  The API Routing object
     *
     * @return  void
     *
     * @since   4.0.0
     */
    public function onBeforeApiRoute(&$router)
    {
        $router->createCRUDRoutes(
            'v1/newsfeeds/feeds',
            'feeds',
            ['component' => 'com_newsfeeds']
        );

        $router->createCRUDRoutes(
            'v1/newsfeeds/categories',
            'categories',
            ['component' => 'com_categories', 'extension' => 'com_newsfeeds']
        );
    }
}

The same content is in 5 releases, Joomla 4.2.0-beta3 to 4.2.1-rc2. See them all, or every version of this file.