gkite13/vtiger-api-bundle

Installs: 23

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:symfony-bundle

v1.0.3 2022-02-14 06:03 UTC

This package is auto-updated.

Last update: 2024-04-14 11:15:30 UTC


README

Installation

$ composer require gkite13/vtiger-api-bundle

Configuration

# config/packages/gkite13_vtiger_api.yaml
gkite13_vtiger_api:
    api:
        site_url: "http://your_crm_url"
        user: "user_name"
        access_key: "user_access_key"

For configure cache pool

# config/packages/cache
pools:
# ...
  my_cache_pool:
    adapter: cache.adapter.filesystem
# config/packages/gkite13_vtiger_api.yaml
gkite13_vtiger_api:
# ...
  cache:
    pool: my_cache_pool

Usage

Query

$queryString = "SELECT * FROM ModuleName";
$result = $this->vtigerApi->query($queryString);

Retrieve

To retrieve a record, you need a vtiger_ws_entity id and entityId.

$leadId = "10x12345";
$result = $this->vtigerApi->retrieve($leadId);

Create

$lead = new \stdClass();
$lead->property1 = 'test';
$lead->property2 = 12345;
$result = $this->vtigerApi->create('EntityType', $lead);

Update

$leadId = "10x12345";
$lead = $this->vtigerApi->retrieve($leadId);
$lead->property1 = 'test2';
$lead->property2 = 123;
$result = $this->vtigerApi->update($lead);

Delete

$leadId = "10x12345";
$result = $this->vtigerApi->delete($leadId);