• Модуль: seo
  • Путь к файлу: ~/bitrix/modules/seo/lib/engine/yandex.php
  • Класс: BitrixSeoEngineYandex
  • Вызов: Yandex::getOriginalTexts
public function getOriginalTexts($domain)
{
	$domain = ToLower($domain);
	$hostId = $this->getHostId($domain);
	
	$counter = 0;
	$limit = self::ORIGINAL_TEXT_SHOW_COUNT;
	$result = array(
		'count' => 0,
		'quota_remainder' => 0,
		'can-add' =>false,
		'original_texts' => array(),
	);
	
//		recursive collect text ehilw not catch limit
	while($counter < $limit)
	{
//			default limit 10, may set other value
		$params = array('offset' => $counter);
		
		$stepResult = $this->getOriginalTextsRecursive($hostId, $params);
		$result['count'] = $stepResult['count'];
		$result['quota_remainder'] = $stepResult['quota_remainder'];
		$result['can-add'] = intval($result['quota_remainder']) > 0;
		$result['original_texts'] = array_merge($result['original_texts'], $stepResult['original_texts']);
		$counter += count($stepResult['original_texts']);
		
//			if catch last text - exit
		if($counter >= $result['count'])
			break;
	}
	
	return $result;
}