CoreFiles by mySites.guru
SyndicateHelper.php47 lines, 994 bytes, from Joomla_4.0.0-beta4-Beta-Full_Package.zip
Raw History Compare with 4.0.0-beta3
md5
365bd221fe446d80c42b2be2ba3e4f86
sha1
0c3e36aa1395b2b382987158f918301531dcb931
sha256
adb42825a607e48eb672099bf28808268c34ea109d0914c40227137f696ef460
<?php
/**
 * @package     Joomla.Site
 * @subpackage  mod_syndicate
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

namespace Joomla\Module\Syndicate\Site\Helper;

\defined('_JEXEC') or die;

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  array  The link as a string
	 *
	 * @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;
			}
		}
	}
}

The same content is in 4 releases, Joomla 4.0.0-beta to 4.0.0-beta4. See them all, or every version of this file.