2011-04-19 15:59:50 +00:00
|
|
|
<?php
|
2011-06-27 16:34:26 +00:00
|
|
|
require_once 'Functions.php';
|
|
|
|
Class Search extends GiantFunction
|
2011-04-19 15:59:50 +00:00
|
|
|
{
|
2011-06-27 16:34:26 +00:00
|
|
|
private $soapG;
|
|
|
|
protected $label;
|
|
|
|
protected $labelResults;
|
|
|
|
protected $query;
|
|
|
|
protected $methodes = array(
|
2011-04-19 15:59:50 +00:00
|
|
|
'search',
|
|
|
|
'advancedSearch'
|
|
|
|
);
|
|
|
|
|
|
|
|
private $headerSearch;
|
|
|
|
private $nbOfResults;
|
|
|
|
|
2011-06-28 15:28:45 +00:00
|
|
|
public function __construct($soap)
|
2011-04-19 15:59:50 +00:00
|
|
|
{
|
2011-06-30 15:30:43 +00:00
|
|
|
$this->soapG = $soap;
|
|
|
|
$this->label = new Zend_Config_Ini('Giant/Traductions/label.ini', 'search');
|
|
|
|
$this->labelResults = new Zend_Config_Ini('Giant/Traductions/results.ini', 'search');
|
|
|
|
$this->headerSearch = new stdClass();
|
2011-04-19 15:59:50 +00:00
|
|
|
$this->headerSearch->IncludePhoneticMatches = FALSE;
|
2011-06-30 15:30:43 +00:00
|
|
|
$this->headerSearch->IncludeSuggestions = FALSE;
|
|
|
|
$this->soapG->getAllMethodesFromWsdl('search');
|
2011-04-19 15:59:50 +00:00
|
|
|
}
|
|
|
|
|
2011-06-28 15:28:45 +00:00
|
|
|
protected function search($paramatres, $page)
|
2011-04-19 15:59:50 +00:00
|
|
|
{
|
2011-06-28 15:28:45 +00:00
|
|
|
$this->query = $paramatres->Query;
|
|
|
|
$search = array_merge((array)$paramatres, (array)$this->headerSearch);
|
2011-06-27 16:34:26 +00:00
|
|
|
try {
|
|
|
|
$result = $this->soapG->search($search);
|
|
|
|
} catch (SoapFault $soapFault) {
|
|
|
|
echo 'Erreur Soap : '.$soapFault->getMessage();}
|
|
|
|
return ($result);
|
2011-04-19 15:59:50 +00:00
|
|
|
}
|
|
|
|
|
2011-06-28 15:28:45 +00:00
|
|
|
public function advancedSearch($parametres, $page)
|
2011-04-19 15:59:50 +00:00
|
|
|
{
|
2011-06-29 14:39:30 +00:00
|
|
|
$advanced = array_merge((array)$parametres, (array)$this->headerSearch);
|
|
|
|
$this->query = $advanced->Query;
|
2011-06-27 16:34:26 +00:00
|
|
|
try {
|
|
|
|
$result = $this->soapG->advancedSearch($advanced);
|
|
|
|
} catch (SoapFault $soapFault) {
|
|
|
|
echo 'Erreur Soap : '.$soapFault->getMessage();}
|
|
|
|
return($result);
|
2011-04-19 15:59:50 +00:00
|
|
|
}
|
|
|
|
|
2011-06-27 16:34:26 +00:00
|
|
|
protected function Tier2Search($Query, $StartRow, $NumRows)
|
2011-04-19 15:59:50 +00:00
|
|
|
{
|
2011-06-27 16:34:26 +00:00
|
|
|
$parametres = new stdClass();
|
|
|
|
$parametres->Query = $Query;
|
|
|
|
$parametres->StartRow = $StartRow;
|
|
|
|
$parametres->NumRows = $NumRows;
|
|
|
|
try {
|
|
|
|
$this->soapG->Tier2Search($parametres);
|
|
|
|
} catch (SoapFault $soapFault) {
|
|
|
|
echo 'Erreur Soap : '.$soapFault->getMessage();}
|
2011-04-19 15:59:50 +00:00
|
|
|
}
|
|
|
|
|
2011-06-27 16:34:26 +00:00
|
|
|
public function Tier2SearchMethods()
|
2011-04-19 15:59:50 +00:00
|
|
|
{
|
2011-06-27 16:34:26 +00:00
|
|
|
try {
|
|
|
|
$result = $this->soapG->Tier2SearchMethods();
|
|
|
|
} catch (SoapFault $soapFault) {
|
|
|
|
echo 'Erreur Soap : '.$soapFault->getMessage();
|
2011-04-19 15:59:50 +00:00
|
|
|
}
|
2011-06-27 16:34:26 +00:00
|
|
|
return ($result);
|
2011-04-19 15:59:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public function __destruct()
|
|
|
|
{
|
2011-06-27 16:34:26 +00:00
|
|
|
unset($this->soapG);
|
2011-04-19 15:59:50 +00:00
|
|
|
}
|
|
|
|
}
|