CoreFiles by mySites.guru
SyndicateHelper.php46 lines, 1,077 bytes, from Joomla_4.2.1-rc2-Release_Candidate-Full_Package.zip
Raw History Compare with 4.2.1-rc1
md5
229ecdcda2b09ec21a91d65bb71bb3af
sha1
8812115dee83f5215ed7182cd56851391162715f
sha256
18f29cd1f8d03f0f2ef938790d36d8dbb0873db10fde99ea06ab10bae1594118
<?php

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

namespace Joomla\Module\Syndicate\Site\Helper;

use Joomla\CMS\Document\HtmlDocument;
use Joomla\Registry\Registry;
use Joomla\Utilities\ArrayHelper;

/**
 * Helper for mod_syndicate
 *
 * @since  1.5
 */
class SyndicateHelper
{
    /**
     * Gets the link
     *
     * @param   Registry      $params    The module parameters
     * @param   HtmlDocument  $document  The document
     *
     * @return  string|null  The link as a string, if found
     *
     * @since   1.5
     */
    public static function getLink(Registry $params, HtmlDocument $document)
    {
        foreach ($document->_links as $link => $value) {
            $value = ArrayHelper::toString($value);

            if (strpos($value, 'application/' . $params->get('format') . '+xml')) {
                return $link;
            }
        }

        return null;
    }
}

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.