CoreFiles by mySites.guru
SyndicateHelper.php47 lines, 993 bytes, from Joomla_4.0.0-alpha6-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha5
md5
c01acfa01371d527d556875fb6d2db24
sha1
54fffd55bb9363eece9db67212398765b58733d6
sha256
f744eaab43391fd56f3debe35ced4aa6366743cd7d3fb9b4fc15fe264662596e
<?php
/**
 * @package     Joomla.Site
 * @subpackage  mod_syndicate
 *
 * @copyright   Copyright (C) 2005 - 2018 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 2 releases, Joomla 4.0.0-alpha5 to 4.0.0-alpha6. See them all, or every version of this file.