Spade

Mini Shell

Directory:~$ /home/lmsyaran/www/pusher/
Upload File

[Home] [System Details] [Kill Me]
Current File:~$ /home/lmsyaran/www/pusher/Database.php.tar

home/lmsyaran/public_html/htaccess.back/osl/Utils/Database.php000064400000001552151173170410020435
0ustar00<?php
/**
 * @package     OSL
 * @subpackage  Controller
 *
 * @copyright   Copyright (C) 2016 Ossolution Team, Inc. All rights
reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE
 */

namespace OSL\Utils;

use JDatabaseQuery;

class Database
{
	/**
	 * Helper method to get fields from database table in case the site is
multilingual
	 *
	 * @param \JDatabaseQuery $query
	 * @param array           $fields
	 * @param string          $fieldSuffix
	 */
	public static function getMultilingualFields(JDatabaseQuery $query,
$fields = array(), $fieldSuffix)
	{
		foreach ($fields as $field)
		{
			$alias  = $field;
			$dotPos = strpos($field, '.');

			if ($dotPos !== false)
			{
				$alias = substr($field, $dotPos + 1);
			}

			$query->select($query->quoteName($field . $fieldSuffix, $alias));
		}
	}
}