<commit_before><?php


/**
 * @author <NAME>, w3concepts AG
 * @copyright Copyright &copy; 2010, w3concepts AG
 */

class Aitsu_Persistence_View_Articles {

	public static function art($cat, $idlang, $syncLang) {

		return Aitsu_Db :: fetchAll('' .
		'select ' .
		'	artlang.idart, ' .
		'	artlang.idartlang, ' .
		'	artlang.title, ' .
		'	artlang.online, ' .
		'	if(catlang.startidartlang = artlang.idartlang, 1, 0) as isstart ' .
		'from _art_lang as artlang ' .
		'left join _cat_art as catart on artlang.idart = catart.idart ' .
		'left join _cat_lang as catlang on artlang.idlang = catlang.idlang and catart.idcat = catlang.idcat ' .
		'where ' .
		'	catart.idcat = :cat ' .
		'	and artlang.idlang = :idlang ' .
		'order by ' .
		'	isstart desc, ' .
		'	artlang.title asc ', array (
			':cat' => $cat,
			':idlang' => $idlang
		));
	}

	public static function full($cat, $syncLang = null, $idlang = null) {

		$idlang = $idlang == null ? Aitsu_Registry :: get()->session->currentLanguage : $idlang;

		if ($syncLang != null) {			
			return Aitsu_Db :: fetchAll('' .
			'select ' .
			'	artlang.idart idart, ' .
			'	artlang.idartlang idartlang, ' .
			'	artlang.title title, ' .
			'	artlang.urlname urlname, ' .
			'	artlang.pagetitle pagetitle, ' .
			'	artlang.online online, ' .
			'	if (artlang.published = \'0000-00-00 00:00:00\', 0, 1) published, ' .
			'	if(catlang.startidartlang = artlang.idartlang, 1, 0) isstart, ' .
			'	if(oartlang.idartlang is null, 0, 1) synced, ' .
			'	artlang.artsort artsort ' .
			'from _art_lang as artlang ' .
			'left join _art_lang as sartlang on artlang.idart = sartlang.idart and sartlang.idlang = :syncLang ' .
			'left join _art_lang as oartlang on artlang.idart = oartlang.idart and oartlang.idlang = :idlang ' .
			'left join _cat_art as catart on artlang.idart = catart.idart ' .
			'left join _cat_lang as catlang on artlang.idlang = catlang.idlang and catart.idcat = catlang.idcat ' .
			'where ' .
			'	catart.idcat = :cat ' .
			'	and ( ' .
			'		sartlang.idartlang is null and oartlang.idartlang is not null ' .
			'		or sartlang.idartlang is not null and oartlang.idartlang is null ' .
			'		or artlang.idlang = :idlang ' .
			'		) ' .
			'group by ' .
			'	artlang.idart ' .
			'order by ' .
			'	isstart desc, ' .
			'	artlang.title asc', array (
				':cat' => $cat,
				':idlang' => $idlang,
				':syncLang' => $syncLang
			));
		}

		return Aitsu_Db :: fetchAll('' .
		'select ' .
		'	artlang.idart as idart, ' .
		'	artlang.idartlang as idartlang, ' .
		'	artlang.title as title, ' .
		'	artlang.urlname as urlname, ' .
		'	artlang.pagetitle as pagetitle, ' .
		'	artlang.online as online, ' .
		'	if (pub.pubtime is null or artlang.lastmodified != pub.pubtime, 0, 1) as published, ' .
		'	if(catlang.startidartlang = artlang.idartlang, 1, 0) as isstart, ' .
		'	1 as synced ' .
		'from _art_lang as artlang ' .
		'left join _pub as pub on artlang.idartlang = pub.idartlang and pub.status = 1 ' .
		'left join _cat_art as catart on artlang.idart = catart.idart ' .
		'left join _cat_lang as catlang on artlang.idlang = catlang.idlang and catart.idcat = catlang.idcat ' .
		'where ' .
		'	catart.idcat = :cat ' .
		'	and artlang.idlang = :idlang ' .
		'order by ' .
		'	isstart desc, ' .
		'	artlang.title asc', array (
			':cat' => $cat,
			':idlang' => $idlang
		));
	}
}<commit_msg>Added artsort to the data store.<commit_after><?php


/**
 * @author <NAME>, w3concepts AG
 * @copyright Copyright &copy; 2010, w3concepts AG
 */

class Aitsu_Persistence_View_Articles {

	public static function art($cat, $idlang, $syncLang) {

		return Aitsu_Db :: fetchAll('' .
		'select ' .
		'	artlang.idart, ' .
		'	artlang.idartlang, ' .
		'	artlang.title, ' .
		'	artlang.online, ' .
		'	if(catlang.startidartlang = artlang.idartlang, 1, 0) as isstart ' .
		'from _art_lang as artlang ' .
		'left join _cat_art as catart on artlang.idart = catart.idart ' .
		'left join _cat_lang as catlang on artlang.idlang = catlang.idlang and catart.idcat = catlang.idcat ' .
		'where ' .
		'	catart.idcat = :cat ' .
		'	and artlang.idlang = :idlang ' .
		'order by ' .
		'	isstart desc, ' .
		'	artlang.title asc ', array (
			':cat' => $cat,
			':idlang' => $idlang
		));
	}

	public static function full($cat, $syncLang = null, $idlang = null) {

		$idlang = $idlang == null ? Aitsu_Registry :: get()->session->currentLanguage : $idlang;

		if ($syncLang != null) {			
			return Aitsu_Db :: fetchAll('' .
			'select ' .
			'	artlang.idart idart, ' .
			'	artlang.idartlang idartlang, ' .
			'	artlang.title title, ' .
			'	artlang.urlname urlname, ' .
			'	artlang.pagetitle pagetitle, ' .
			'	artlang.online online, ' .
			'	if (artlang.published = \'0000-00-00 00:00:00\', 0, 1) published, ' .
			'	if(catlang.startidartlang = artlang.idartlang, 1, 0) isstart, ' .
			'	if(oartlang.idartlang is null, 0, 1) synced, ' .
			'	artlang.artsort artsort ' .
			'from _art_lang as artlang ' .
			'left join _art_lang as sartlang on artlang.idart = sartlang.idart and sartlang.idlang = :syncLang ' .
			'left join _art_lang as oartlang on artlang.idart = oartlang.idart and oartlang.idlang = :idlang ' .
			'left join _cat_art as catart on artlang.idart = catart.idart ' .
			'left join _cat_lang as catlang on artlang.idlang = catlang.idlang and catart.idcat = catlang.idcat ' .
			'where ' .
			'	catart.idcat = :cat ' .
			'	and ( ' .
			'		sartlang.idartlang is null and oartlang.idartlang is not null ' .
			'		or sartlang.idartlang is not null and oartlang.idartlang is null ' .
			'		or artlang.idlang = :idlang ' .
			'		) ' .
			'group by ' .
			'	artlang.idart ' .
			'order by ' .
			'	isstart desc, ' .
			'	artlang.title asc', array (
				':cat' => $cat,
				':idlang' => $idlang,
				':syncLang' => $syncLang
			));
		}

		return Aitsu_Db :: fetchAll('' .
		'select ' .
		'	artlang.idart idart, ' .
		'	artlang.idartlang idartlang, ' .
		'	artlang.title title, ' .
		'	artlang.urlname urlname, ' .
		'	artlang.pagetitle pagetitle, ' .
		'	artlang.online online, ' .
		'	if (pub.pubtime is null or artlang.lastmodified != pub.pubtime, 0, 1) published, ' .
		'	if(catlang.startidartlang = artlang.idartlang, 1, 0) isstart, ' .
		'	1 as synced, ' .
		'	artlang.artsort artsort ' .
		'from _art_lang as artlang ' .
		'left join _pub as pub on artlang.idartlang = pub.idartlang and pub.status = 1 ' .
		'left join _cat_art as catart on artlang.idart = catart.idart ' .
		'left join _cat_lang as catlang on artlang.idlang = catlang.idlang and catart.idcat = catlang.idcat ' .
		'where ' .
		'	catart.idcat = :cat ' .
		'	and artlang.idlang = :idlang ' .
		'order by ' .
		'	isstart desc, ' .
		'	artlang.title asc', array (
			':cat' => $cat,
			':idlang' => $idlang
		));
	}
}
{'fraction_non_alphanumeric': 0.14748736247398156, 'fraction_numerical': 0.010110020814748736, 'mean_word_length': 2.749721293199554, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1876468', 'n_tokens_mistral': 2994, 'n_tokens_neox': 2669, 'n_words': 607}