extranet/library/Giant/GiantMethodes.lib.php
2011-10-13 10:22:44 +00:00

261 lines
8.9 KiB
PHP

<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
define("DATA_SET_VERSION", '1.0');
Class Search extends GiantFunction
{
private $soapG;
protected $label;
protected $labelResults;
protected $query;
protected $methodes = array(
'search',
'advancedSearch'
);
private $headerSearch;
private $nbOfResults;
public function __construct($soap)
{
$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();
$this->headerSearch->IncludePhoneticMatches = FALSE;
$this->headerSearch->IncludeSuggestions = FALSE;
$this->soapG->getAllMethodesFromWsdl('search');
}
protected function search($paramatres, $page)
{
$this->query = $paramatres->Query;
$search = array_merge((array)$paramatres, (array)$this->headerSearch);
try {
$result = $this->soapG->search($search);
} catch (SoapFault $soapFault) {
echo 'Erreur Soap : '.$soapFault->getMessage();}
return ($result);
}
public function advancedSearch($parametres, $page)
{
$advanced = array_merge((array)$parametres, (array)$this->headerSearch);
$this->query = $advanced->Query;
try {
$result = $this->soapG->advancedSearch($advanced);
} catch (SoapFault $soapFault) {
echo 'Erreur Soap : '.$soapFault->getMessage();}
return($result);
}
protected function Tier2Search($Query, $StartRow, $NumRows)
{
$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();}
}
public function Tier2SearchMethods()
{
try {
$result = $this->soapG->Tier2SearchMethods();
} catch (SoapFault $soapFault) {
echo 'Erreur Soap : '.$soapFault->getMessage();
}
return ($result);
}
public function __destruct()
{
unset($this->soapG);
}
}
Class CreditData extends GiantFunction
{
private $soapG;
protected $companyId;
protected $methodes = array(
'RetreiveOptions', 'OrderDataSet',
'RetrieveOrderStatus', 'RetrieveDataSet',
'StartInvestigation', 'StartMonitoring',
'UpdateMonitoringOptions', 'StopMonitoring',
'RetrieveMonitoringEventsForOrder', 'RetrieveMonitoringEventsForCustomer',
'RetrieveMonitoringEventsForConsumer', 'Ping'
);
public function __construct($soapG, $companyId)
{
$this->soapG = $soapG;
$this->companyId = $companyId;
$this->soapG->getAllMethodesFromWsdl('credit-data');
}
protected function RetreiveOptions()
{
$parametres = new stdClass();
$parametres->CompanyId = $this->companyId;
try {
$result = $this->soapG->RetrieveOptions($parametres);
} catch (SoapFault $soapFault) {
echo 'Erreur Soap : '.$soapFault->getMessage();}
return ($result);
}
protected function OrderDataSet($DataSetType, $Version = null, $LanguageCode = 'en')
{
$parametres = new stdClass();
$parametres->CompanyId = $this->companyId;
$parametres->DataSetType = $DataSetType;
$parametres->DataSetVersion = DATA_SET_VERSION;
$parametres->LanguageCode = $LanguageCode;
try {
$result = $this->soapG->OrderDataSet($parametres);
} catch (SoapFault $soapFault) {
echo 'Erreur Soap : '.$soapFault->getMessage();}
return ($result);
}
protected function RetrieveOrderStatus($InternalOrderId)
{
$parametres = new stdClass();
$parametres->InternalOrderId = $InternalOrderId;
try {
$result = $this->soapG->RetrieveOrderStatus($parametres);
} catch (SoapFault $soapFault) {
echo 'Erreur Soap : '.$soapFault->getMessage();}
return ($result);
}
protected function RetrieveDataSet($InternalOrderId)
{
$parametres = new stdClass();
$parametres->InternalOrderId = $InternalOrderId;
try {
$result = $this->soapG->RetrieveDataSet($parametres);
} catch (SoapFault $soapFault) {
echo 'Erreur Soap : '.$soapFault->getMessage();}
return ($result);
}
protected function StartInvestigation($DataSetType, $ServiceLevelName, $Version = null, $LanguageCode = null)
{
$parametres = new stdClass();
$parametres->DataSetType = $DataSetType;
$parametres->ServiceLevelName = $ServiceLevelName;
$parametres->Version = $Version;
$parametres->LanguageCode = $LanguageCode;
try {
$result = $this->soapG->StartInvestigation($parametres);
} catch (SoapFault $soapFault) {
echo 'Erreur Soap : '.$soapFault->getMessage();}
return ($result);
}
protected function StartMonitoring($CategorieName, $EventType, $PreferredStartDate, $PreferredEndDate, $Version = null, $LanguageCode = null)
{
$parametres = new stdClass();
$parametres->CategorieName = $CategorieName;
$parametres->EventType = $EventType;
$parametres->PreferredStartDate = $PreferredStartDate;
$parametres->PreferredEndDate = $PreferredEndDate;
$parametres->Version = $Version;
$parametres->LanguageCode = $LanguageCode;
try {
$result = $this->soapG->StartMonitoring($parametres);
} catch (SoapFault $soapFault) {
echo 'Erreur Soap : '.$soapFault->getMessage();}
return ($result);
}
protected function UpdateMonitoringOptions($InternalOrderId, $NewCategorieName, $NewEventType, $NewPreferredStartDate, $NewVersion = null, $NewLanguageCode = null)
{
$parametres = new stdClass();
$parametres->InternalOrderId = $InternalOrderId;
$parametres->NewCategorieName = $NewCategorieName;
$parametres->NewEventType = $NewEventType;
$parametres->NewPreferredStartDate = $NewPreferredStartDate;
$parametres->NewVersion = $NewVersion;
$parametres->NewLanguageCode = $NewLanguageCode;
try {
$result = $this->soapG->UpdateMonitoringOptions($parametres);
} catch (SoapFault $soapFault) {
echo 'Erreur Soap : '.$soapFault->getMessage();}
return ($result);
}
protected function StopMonitoring($InternalOrderId, $PreferredEndDate)
{
$parametres = new stdClass();
$parametres->InternalOrderId = $InternalOrderId;
$parametres->PreferredEndDate = $PreferredEndDate;
try {
$result = $this->soapG->StopMonitoring($parametres);
} catch (SoapFault $soapFault) {
echo 'Erreur Soap : '.$soapFault->getMessage();}
return ($result);
}
protected function RetrieveMonitoringEventsForOrder($InternalOrderId, $StartFrom)
{
$parametres = new stdClass();
$parametres->InternalOrderId = $InternalOrderId;
$parametres->StartFrom = $StartFrom;
try {
$result = $this->soapG->RetrieveMonitoringEventsForOrder($parametres);
} catch (SoapFault $soapFault) {
echo 'Erreur Soap : '.$soapFault->getMessage();}
return ($result);
}
protected function RetrieveMonitoringEventsForCustomer($StartFrom)
{
$parametres = new stdClass();
$parametres->StartFrom = $StartFrom;
try {
$result = $this->soapG->RetrieveMonitoringEventsForCustomer($parametres);
} catch (SoapFault $soapFault) {
echo 'Erreur Soap : '.$soapFault->getMessage();
}
return ($result);
}
protected function RetrieveMonitoringEventsForConsumer($StartFrom)
{
$parametres = new stdClass();
$parametres->StartFrom = $StartFrom;
try {
$result = $this->soapG->RetrieveMonitoringEventsForConsumer($parametres);
} catch (SoapFault $soapFault) {
echo 'Erreur Soap : '.$soapFault->getMessage();}
return ($result);
}
protected function Ping($Type)
{
$parametres = new stdClass();
$parametres->Type = $Type;
try {
$result = $this->soapG->Ping($parametres);
} catch (SoapFault $soapFault) {
echo 'Erreur Soap : '.$soapFault->getMessage();
}
return ($result);
}
public function __destruct()
{
unset($this->soapG);
}
}
?>