PHP code example of inspetor / inspetor-php
1. Go to this page and download the library: Download inspetor/inspetor-php library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
inspetor / inspetor-php example snippets
composer
namespace NiceCompany\Inspetor;
use Inspetor\InspetorClient;
class Inspetor
{
public function __construct()
{
$this->inspetor = new InspetorClient($inspetor_config);
}
/**
* @return Inspetor\InspetorClient $client
*/
public function getClient() {
return $this->inspetor;
}
}
namespace NiceCompany\SaleFolder;
use NiceCompany\Inspetor\InspetorClass;
class Sale {
...
public function createSale() {
// $company_sale is an example object of the company with sale data
$inspetor_sale = $this->inspetorSaleBuilder($company_sale);
$this->inspetor = new Inspetor();
$inspetor->getClient()->trackSaleCreation($inspetor_sale);
}
public function inspetorSaleBuilder($company_sale) {
$model = $this->inspetor->getClient()->getInspetorSale();
$model->setId($company_sale->getId());
$model->setAccountId($company_sale->getUserId());
$model->setStatus($company_sale->getSaleStatus());
$model->setIsFraud($company_sale->getFraud());
$model->set...
return $model;
}
...
}