2017 © Pedro PelĂĄez
 

library libsugarcrm

This library provides a various classes to interact with SugarCRM

image

inetprocess/libsugarcrm

This library provides a various classes to interact with SugarCRM

  • Thursday, March 1, 2018
  • by edyan
  • Repository
  • 9 Watchers
  • 8 Stars
  • 7,368 Installations
  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 4 Forks
  • 1 Open issues
  • 43 Versions
  • 8 % Grown

The README.md

inetprocess/libsugarcrm

That library allows anybody to interact with a SugarCRM application, outside that application. Suppose you need to do a importation script, running every night, with a very specific set of transformations or check. Then you need that kind of tools to be able to "Login" to SugarCRM, create or update beans, do SQL queries, etc ..., (*1)

Warning

  • Be very careful that Sugar doesn't do a very "clean" job so it's better to deactivate the strict standards erorr reporting in PHP to be able to use it. When I launch my script, I usualy do something like:
php -d 'error_reporting=E_ALL & ~E_STRICT'  test.php
  • If you are not using my classes in another class (if you do like in examples below, directly calling the library), be more careful: don't name your variables like sugar does, else you'll overwrite it (example: $db or $log)., (*2)

  • Last but not the least: you'll be able to instanciate the EntryPoint for only one instance of Sugar ! It uses GLOBALS variable such as $GLOBALS['db'] and I let you imagine what will happen if it's overwritten by another Instance of SugarCRM ;), (*3)

Classes

Inet\SugarCRM\Application

Gives general information about SugarCRM Installation. Others classes depends on this one., (*4)

Usage Example:, (*5)

<?php
require_once 'vendor/autoload.php';
use Psr\Log\NullLogger;
use Inet\SugarCRM\Application;

$sugarApp = new Application(new NullLogger(), '/home/sugarcrm/www');
echo $sugarApp->getPath();
if ($sugarApp->isValid()) {
    echo $sugarApp->getVersion();
}

Inet\SugarCRM\EntryPoint

It says where is Sugar and does the basic steps to "login" into SugarCRM. EntryPoint needs a logger because other classes log a lot of stuff. The EntryPoint can only be loaded once for the entire program., (*6)

Usage Example:, (*7)

<?php
require_once 'vendor/autoload.php';
use Psr\Log\NullLogger;
use Inet\SugarCRM\Application;
use Inet\SugarCRM\EntryPoint;

if (!EntryPoint::isCreated()) {
    $nullLogger = new NullLogger;
    $sugarApp = new Application($nullLogger, '/home/sugarcrm/www');
    // enter sugar
    EntryPoint::createInstance($sugarApp, '1');
}
$sugarEP = EntryPoint::getInstance();

Inet\SugarCRM\Bean

Most complete class to : * Get a list of available modules (_getBeansList()) * Get an Bean (_getBean()) * Create a Bean (_newBean()) * Get a list of records for a module (_getList()) * ..., (*8)

Usage Example:, (*9)

<?php
require_once 'vendor/autoload.php';
use Psr\Log\NullLogger;
use Inet\SugarCRM\EntryPoint;
use Inet\SugarCRM\Bean;

if (!EntryPoint::isCreated()) {
    $nullLogger = new NullLogger;
    $sugarApp = new Application($nullLogger, '/home/sugarcrm/www');
    // enter sugar
    EntryPoint::createInstance($sugarApp, '1');
}
$sugarEP = EntryPoint::getInstance();

// instanciate the Bean class to retrieve User with id 1
$inetSugarBean = new Bean($sugarEP);
$adminUser = $inetSugarBean->getBean('Users', 1);
echo $adminUser->name;

Inet\SugarCRM\BeanFactoryCache

Don't use it directly, it's directly used by Inet\SugarCRM\Bean to clean the cache during long loops., (*10)

Inet\SugarCRM\DB

Useful to query SugarCRM DB directly., (*11)

Usage Example:, (*12)

<?php
require_once 'vendor/autoload.php';
use Inet\SugarCRM\EntryPoint;
use Inet\SugarCRM\DB;

// get the DB Class
$inetSugarDB = new DB(EntryPoint::getInstance());
$users = $inetSugarDB->query('SELECT * FROM users');
echo count($users);

Inet\SugarCRM\Utils

Various Utils to create labels, dropdown, encode or decode multiselect, etc..., (*13)

Usage Example:, (*14)

<?php
require_once 'vendor/autoload.php';
use Inet\SugarCRM\EntryPoint;
use Inet\SugarCRM\Utils;

// get the Utils Class
$inetSugarUtils = new Utils(EntryPoint::getInstance());
// Convert an array to a multiselect
$convertedArray = $inetSugarUtils->arrayToMultiselect(array('test' => 'inet'));
echo $convertedArray;

Inet\SugarCRM\SugarQueryIterator

Iterator class to iterate in a memory safe way SugarQuery results., (*15)

Usage Example: Loop records 100 to 300, (*16)

<?php
$query = new \SugarQuery();
// setup $query

$iter = new SugarQueryIterator($query);
$iter->setStartOffset(100);
foreach ($iter as $id => $bean) {
   // Do something with $bean
   if ($iter->getIterationCounter() >= 200) {
       break;
   }
}

The Versions

01/03 2018

dev-master

9999999-dev

This library provides a various classes to interact with SugarCRM

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Rémi Sauvat
by Emmanuel Dyan

sugarcrm sugarcli

01/03 2018

1.2.11

1.2.11.0

This library provides a various classes to interact with SugarCRM

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Rémi Sauvat
by Emmanuel Dyan

sugarcrm sugarcli

25/01 2018

1.2.10

1.2.10.0

This library provides a various classes to interact with SugarCRM

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Rémi Sauvat
by Emmanuel Dyan

sugarcrm sugarcli

27/12 2017

1.2.9

1.2.9.0

This library provides a various classes to interact with SugarCRM

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Rémi Sauvat
by Emmanuel Dyan

sugarcrm sugarcli

07/06 2017

1.2.8

1.2.8.0

This library provides a various classes to interact with SugarCRM

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Rémi Sauvat
by Emmanuel Dyan

sugarcrm sugarcli

18/04 2017

1.2.7

1.2.7.0

This library provides a various classes to interact with SugarCRM

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Rémi Sauvat
by Emmanuel Dyan

sugarcrm sugarcli

07/04 2017

1.2.6

1.2.6.0

This library provides a various classes to interact with SugarCRM

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Rémi Sauvat
by Emmanuel Dyan

sugarcrm sugarcli

06/04 2017

1.2.5

1.2.5.0

This library provides a various classes to interact with SugarCRM

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Rémi Sauvat
by Emmanuel Dyan

sugarcrm sugarcli

30/09 2016

1.2.4

1.2.4.0

This library provides a various classes to interact with SugarCRM

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Rémi Sauvat
by Emmanuel Dyan

sugarcrm sugarcli

19/07 2016

1.2.3

1.2.3.0

This library provides a various classes to interact with SugarCRM

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Rémi Sauvat
by Emmanuel Dyan

sugarcrm sugarcli

06/06 2016

1.2.2

1.2.2.0

This library provides a various classes to interact with SugarCRM

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Rémi Sauvat
by Emmanuel Dyan

sugarcrm sugarcli

27/05 2016

1.2.1

1.2.1.0

This library provides a various classes to interact with SugarCRM

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Rémi Sauvat
by Emmanuel Dyan

sugarcrm sugarcli

15/04 2016

1.2.0

1.2.0.0

This library provides a various classes to interact with SugarCRM

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Rémi Sauvat
by Emmanuel Dyan

sugarcrm sugarcli

14/04 2016

1.1.22-beta

1.1.22.0-beta

This library provides a various classes to interact with SugarCRM

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Rémi Sauvat
by Emmanuel Dyan

sugarcrm sugarcli

01/04 2016

1.1.21-beta

1.1.21.0-beta

This library provides a various classes to interact with SugarCRM

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Rémi Sauvat
by Emmanuel Dyan

sugarcrm sugarcli

30/03 2016

1.1.20-beta

1.1.20.0-beta

This library provides a various classes to interact with SugarCRM

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Rémi Sauvat
by Emmanuel Dyan

sugarcrm sugarcli

25/03 2016

1.1.19-beta

1.1.19.0-beta

This library provides a various classes to interact with SugarCRM

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Rémi Sauvat
by Emmanuel Dyan

sugarcrm sugarcli

09/03 2016

1.1.18-beta

1.1.18.0-beta

This library provides a various classes to interact with SugarCRM

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Rémi Sauvat
by Emmanuel Dyan

sugarcrm sugarcli

23/02 2016

1.1.17-beta

1.1.17.0-beta

This library provides a various classes to interact with SugarCRM

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Rémi Sauvat
by Emmanuel Dyan

sugarcrm sugarcli

19/02 2016

1.1.16-beta

1.1.16.0-beta

This library provides a various classes to interact with SugarCRM

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Rémi Sauvat
by Emmanuel Dyan

sugarcrm sugarcli

17/02 2016

1.1.15-beta

1.1.15.0-beta

This library provides a various classes to interact with SugarCRM

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Rémi Sauvat
by Emmanuel Dyan

sugarcrm sugarcli

03/02 2016

1.1.14-beta

1.1.14.0-beta

This library provides a various classes to interact with SugarCRM

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Rémi Sauvat
by Emmanuel Dyan

sugarcrm sugarcli

27/01 2016

1.1.13-beta

1.1.13.0-beta

This library provides a various classes to interact with SugarCRM

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Rémi Sauvat
by Emmanuel Dyan

sugarcrm sugarcli

26/01 2016

1.1.12-beta

1.1.12.0-beta

This library provides a various classes to interact with SugarCRM

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Rémi Sauvat
by Emmanuel Dyan

sugarcrm sugarcli

20/01 2016

1.1.11-beta

1.1.11.0-beta

This library provides a various classes to interact with SugarCRM

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Rémi Sauvat
by Emmanuel Dyan

sugarcrm sugarcli

14/01 2016

1.1.10-beta

1.1.10.0-beta

This library provides a various classes to interact with SugarCRM

  Sources   Download

GPL-2.0

The Requires

 

The Development Requires

by Emmanuel Dyan

sugarcrm sugarcli

14/01 2016

1.1.9-beta

1.1.9.0-beta

This library provides a various classes to interact with SugarCRM

  Sources   Download

GPL-2.0

The Requires

 

The Development Requires

by Emmanuel Dyan

sugarcrm sugarcli

12/01 2016

dev-langfilecleaner

dev-langfilecleaner

This library provides a various classes to interact with SugarCRM

  Sources   Download

GPL-2.0

The Requires

 

The Development Requires

by Emmanuel Dyan

sugarcrm sugarcli

06/01 2016

1.1.8-beta

1.1.8.0-beta

This library provides a various classes to interact with SugarCRM

  Sources   Download

GPL-2.0

The Requires

 

The Development Requires

by Emmanuel Dyan

sugarcrm sugarcli

08/12 2015

1.1.7-beta

1.1.7.0-beta

This library provides a various classes to interact with SugarCRM

  Sources   Download

The Requires

 

The Development Requires

by Emmanuel Dyan

sugarcrm

08/12 2015

1.1.6-beta

1.1.6.0-beta

This library provides a various classes to interact with SugarCRM

  Sources   Download

The Requires

 

The Development Requires

by Emmanuel Dyan

sugarcrm

08/12 2015

1.1.5-beta

1.1.5.0-beta

This library provides a various classes to interact with SugarCRM

  Sources   Download

The Requires

 

The Development Requires

by Emmanuel Dyan

sugarcrm

03/12 2015

1.1.4-beta

1.1.4.0-beta

This library provides a various classes to interact with SugarCRM

  Sources   Download

The Requires

 

The Development Requires

by Emmanuel Dyan

sugarcrm

03/12 2015

1.1.3-beta

1.1.3.0-beta

This library provides a various classes to interact with SugarCRM

  Sources   Download

The Requires

 

The Development Requires

by Emmanuel Dyan

sugarcrm

02/12 2015

1.1.2-beta

1.1.2.0-beta

This library provides a various classes to interact with SugarCRM

  Sources   Download

The Requires

 

The Development Requires

by Emmanuel Dyan

sugarcrm

02/12 2015

1.1.1-beta

1.1.1.0-beta

This library provides a various classes to interact with SugarCRM

  Sources   Download

The Requires

 

The Development Requires

by Emmanuel Dyan

sugarcrm

02/12 2015

1.1.0-beta

1.1.0.0-beta

This library provides a various classes to interact with SugarCRM

  Sources   Download

The Requires

 

The Development Requires

by Emmanuel Dyan

sugarcrm

05/10 2015

dev-wip_rsauvatinet

dev-wip_rsauvatinet

This library provides a various classes to interact with SugarCRM

  Sources   Download

The Requires

 

The Development Requires

by Emmanuel Dyan

sugarcrm

05/10 2015

1.0.0-beta

1.0.0.0-beta

This library provides a various classes to interact with SugarCRM

  Sources   Download

The Requires

 

The Development Requires

by Emmanuel Dyan

sugarcrm

29/09 2015

0.9.1

0.9.1.0

This library provides a various classes to interact with SugarCRM

  Sources   Download

The Requires

 

The Development Requires

by Emmanuel Dyan

sugarcrm

02/09 2015

dev-code_cleaning

dev-code_cleaning

This library provides a various classes to interact with SugarCRM

  Sources   Download

The Requires

 

The Development Requires

by Emmanuel Dyan

sugarcrm

02/09 2015

0.9

0.9.0.0

This library provides a various classes to interact with SugarCRM

  Sources   Download

The Requires

 

The Development Requires

by Emmanuel Dyan

sugarcrm

02/09 2015

dev-sugarcli_integration

dev-sugarcli_integration

This library provides a various classes to interact with SugarCRM

  Sources   Download

The Requires

 

The Development Requires

by Emmanuel Dyan

sugarcrm