CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Add member data to db - API or SQL?
Pages: [1]

Author Topic: Add member data to db - API or SQL?  (Read 1429 times)

geddeth

  • Guest
Add member data to db - API or SQL?
December 02, 2009, 12:05:33 pm
I apologize in advance if this is the wrong forum, please direct me elsewhere if that is the case.

I have CiviCRM 3 installed in Joomla and use a 3rd party form extension (Chrono Forms) to allow new members to purchase membership (so also talking to a payment provider) and the member data is entered into a table and table structure of my choosing.

My question is: how should I approach the integration of this data with CiviCRM? How do I ensure that new members are automatically visible and manageable in CiviMember? Do I insert new members automatically into the relevant CiviCRM tables? Or should I somehow use the API hooks to add memberdata?

As you can tell, I am rather new with the CiviCRM data structure and the options available to me, so if someone could point me in the right direction, that would be grand.


Cheers,
G.

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Add member data to db - API or SQL?
December 02, 2009, 09:29:34 pm
I would use the API's to do this (first choice), and drop down to using BAO functions IF you can't do what you want with the APIs (altho I think you can).

Public API doc is here:
http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs

You'll want to get familiar with the basic data model before starting the coding - I would scan the relevant parts of the online Understanding CiviCRM book:

http://en.flossmanuals.net/civicrm

For example, memberships are properties of a contact record - so you'll need to create (or check for existence of) a contact record for each of your membership and THEN create (or renew) the membership record.
Protect your investment in CiviCRM by  becoming a Member!

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Add member data to db - API or SQL?
December 03, 2009, 06:29:04 am
Alternatively, have you looked at the membership module and forms provided by civicrm ?

Might be easier than integrating a new module if the features you needs are "standard"

X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

geddeth

  • Guest
Re: Add member data to db - API or SQL?
December 06, 2009, 03:27:25 pm
Thanks for the replies, folks - I was in fact considering both these options as possible ways to go.

I will have a more thorough look into whether this is really a task of getting CiviMember integrated with the payment service provider.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Add member data to db - API or SQL?

This forum was archived on 2017-11-26.