<commit_before><?php
/**
 * @package cms
 * @subpackage model
 */
class SiteTreeFileExtension extends DataExtension {
	
	function extraStatics() {
		return array(
			'belongs_many_many' => array(
				"BackLinkTracking" => "SiteTree",
			)
		);
	}
	
	/**
	 * @todo Unnecessary shortcut for AssetTableField, coupled with cms module.
	 * 
	 * @return Integer
	 */
	function BackLinkTrackingCount() {
		$pages = $this->owner->BackLinkTracking();
		if($pages) {
			return $pages->Count();
		} else {
			return 0;
		}<commit_msg>BUGFIX Disable subsites filtering in File->BackLinkTracking() if module is installed (AIR-66)<commit_after><?php
/**
 * @package cms
 * @subpackage model
 */
class SiteTreeFileExtension extends DataExtension {
	
	function extraStatics() {
		return array(
			'belongs_many_many' => array(
				"BackLinkTracking" => "SiteTree",
			)
		);
	}
	
	/**
	 * Extend through {@link updateBackLinkTracking()} in your own {@link Extension}.
	 * 
	 * @return ComponentSet
	 */
	function BackLinkTracking($filter = "", $sort = "", $join = "", $limit = "") {
		if(class_exists("Subsite")){
			$rememberSubsiteFilter = Subsite::$disable_subsite_filter;
			Subsite::disable_subsite_filter(true);
		}
		
		$links = $this->owner->getManyManyComponents('BackLinkTracking', $filter, $sort, $join, $limit);
		$this->owner->extend('updateBackLinkTracking', $links);
		
		if(class_exists("Subsite")){
			Subsite::disable_subsite_filter($rememberSubsiteFilter);
		}
		
		return $links;
	}
	
	/**
	 * @todo Unnecessary shortcut for AssetTableField, coupled with cms module.
	 * 
	 * @return Integer
	 */
	function BackLinkTrackingCount() {
		$pages = $this->owner->BackLinkTracking();
		if($pages) {
			return $pages->Count();
		} else {
			return 0;
		}
{'fraction_non_alphanumeric': 0.15019988577955454, 'fraction_numerical': 0.002284408909194746, 'mean_word_length': 4.0489913544668585, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 18, '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': '3087480', 'n_tokens_mistral': 641, 'n_tokens_neox': 556, 'n_words': 118}