PHP code example of rajinha92 / guiadosoftware-sdk

1. Go to this page and download the library: Download rajinha92/guiadosoftware-sdk 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/ */

    

rajinha92 / guiadosoftware-sdk example snippets


$api = new Api('http://guiadosoftware.com', '<YOUR_TOKEN>');

$api->attributeType()->get();

$attributeType = new AttributeType();
$attributeType->setDescription('Test')
              ->setShortDescription('Short Test');
$api->attributeType()->store($attributeType);

$api->attributeType()->attributes($attributeType->getId());

$api->attributeType()->delete($attributeType->getId());

$api->attribute()->bootgrid(0, 10, '', ['id'=>'desc']);

$api->attribute()->get(); //all
$api->attribute()->get($attribute->getId()) //specific attribute

$attribute = new Attribute();
$attribute->setDescription('Test')
          ->setShortDescription('Short Test')
          ->setAttributeTypeId($attributeType->getId())
          ->setOrder(1);
$api->attribute()->store($attribute);

$attribute = $api->attribute()->get(1);
$attribute->setDescription('updated description');
$api->attribute()->update($attribute);

$api->company()->bootgrid(0, 10, '', ['id'=>'desc']);

$api->company()->get(); //all
$api->company()->get($company->getId()) //specific company

$company = new Company();
$company->setName('Test')
          ->setEmail('[email protected]')
          ->setSite('company.com')
          ->setPhoneNumber('(41)99999-9999');
$api->company()->store($company);

$company = $api->company()->get(1);
$company->setName('updated name');
$api->company()->update($company);