1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70:
<?php
namespace Apptus\ESales\Connector\Report;
/**
* Class holding data for rank, count and search rate for a phrase.
*
* This class is used both for <b>Searches with hits</b> and <b>Searches with No Hits</b>.
*
* This class represents 1 row in the top 2 tables in the Search Statistics tab on the Reports page in eSales manager.
*/
class SearchCount {
private $phrase;
private $count;
private $searchRate;
private $rank;
/**
* @param string
* The search phrase. Can not be null.
* @param int
* Number of time this phrase was searched on and resulted in either a hit or a no hit depending on the usage of this SearchCount.
* @param Rate
* Ratio between number of searches for this phrase resulting in a [hit|no hit] and the total number of searches resulting in a [hit|no hit]. Can not be null.
* @param int
* The popularity position for this search phrase in the table.
*/
public function __construct($phrase, $count, Rate $searchRate, $rank) {
if ($phrase === null) {
throw new \InvalidArgumentException('The phrase can not be null.');
}
$this->phrase = $phrase;
$this->count = $count;
$this->searchRate = $searchRate;
$this->rank = $rank;
}
/**
* @return string
* The search phrase.
*/
public function phrase() {
return $this->phrase;
}
/**
* @return int
* Number of time this phrase was searched on and resulted in either a hit or a no hit depending on the usage of this SearchCount.
*/
public function count() {
return $this->count;
}
/**
* @return Rate
* Ratio between number of searches for this phrase resulting in a [hit|no hit] and the total number of searches resulting in a [hit|no hit].
*/
public function searchRate() {
return $this->searchRate;
}
/**
* @return int
* The popularity position for this search phrase in the table.
*/
public function rank() {
return $this->rank;
}
}