2

I'm new to Joomla, CiviCRM and PHP, but looking to help with a small project. I'm looking to grab the members data from CiviCRM and transfer (or update if users already exist) into a different database of an application (that is stand alone code/not in joomla) for users that are members of both. After the migration of existing users is done, then going forward this process would be done when a new user registers as a member in the CiviCRM. A couple questions:

  1. Should I write PHP/SQL to go directly against the CiviCRM Contact table or utilize the CiviCRM API?
  2. Where do I write the actual code to connect to the CiviCRM database, write SQL to grab data, etc.? Is it a Joomla extension, a function when the user clicks Submit in the member registration form in CiviCRM? I'm still trying to figure out the Joomla platform and how coding works in it.
  3. Anything else I should consider?

Thanks so much!

3

You should always use the API and only if there is no other route grab the SQL table. You do not need to connect to any CiviCRM database when using the API. You can find more information on the API in the Developer Guide: https://docs.civicrm.org/dev/en/latest/api/

Do I understand correctly that you want to send data to your other application when a membership is created in CiviCRM? If this is the case you should develop a CiviCRM extension using the post hook. You can find more information on developing an extension in the Developer Guide: https://docs.civicrm.org/dev/en/latest/extensions/ and also on the post hook: https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_post/.

The post hook will allow you to retrieve all the membership data from the $objectRef object when you catch an $objectName Membership and $op create (or probably edit as well when a membership changes?).

Alternatively you can pull data from CiviCRM using the API if synchronizing every hour/day is enough?

| improve this answer | |
0

Maybe this is helpful to connect CiviCRM users/Joomla users ? I have used it in the past. https://www.joomlapolis.com/blog/nick/18849-joomla-to-civicrm-user-sync-2-1-1-released

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.