WT AmoCRM library — Helper

WT Amo CRM library - Documentation
Category: Libraries

Reference for the WT AmoCRM UserHelper used to link Joomla users with AmoCRM contacts.

WT AmoCRM library - Helper

UserHelper

Webtolk\Amocrm\Helper\UserHelper

A helper for synchronizing Joomla users with AmoCRM contacts. It uses the #__lib_wt_amocrm_users_sync table.

Methods

  • checkIsAmoCRMUser(int $joomla_user_id): bool|int
  • Returns the AmoCRM contact ID linked to the Joomla user.

  • checkIsJoomlaUser(int $amocrm_user_id): bool|int

  • Returns the Joomla user ID linked to the AmoCRM contact.

  • addJoomlaAmoCRMUserSync(int $joomla_user_id, int $amocrm_contact_id, bool $is_temporary_user = false): bool

  • Creates a new synchronization link.

  • updateJoomlaAmoCRMUserSync(int $joomla_user_id, int $amocrm_contact_id, bool $is_temporary_user = false): bool

  • Updates an existing synchronization link by Joomla user ID.

  • removeJoomlaAmoCRMUserSync(array $joomla_user_ids = [], array $amocrm_user_ids = []): bool

  • Removes synchronization links by a list of Joomla IDs or a list of AmoCRM IDs.
  • If both lists are passed at the same time, the method does not remove anything and writes an error to the log.

Example

use Webtolk\Amocrm\Helper\UserHelper;

// Link a Joomla user to an AmoCRM contact.
UserHelper::addJoomlaAmoCRMUserSync(42, 123456);

// Check the link.
$contactId = UserHelper::checkIsAmoCRMUser(42);

// Remove links by Joomla user IDs.
UserHelper::removeJoomlaAmoCRMUserSync([42, 43]);

WebTolk Joomla Extensions

107 Extensions
12 Categories
546 Versions released
755263 Downloads