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) »
  • What should creating related memberships look like with 'num_related'
Pages: [1]

Author Topic: What should creating related memberships look like with 'num_related'  (Read 702 times)

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
What should creating related memberships look like with 'num_related'
September 29, 2013, 05:08:37 pm
Now that we have the 'num_related' - the ability to define related memberships (& to choose them) we need to think how an api call to create a membership with 2 or my 3 relationships inheriting would look.

civicrm_api3('membership', 'create', array(
  'contact_id' => 3,
  'membership_type_id' => 1,
  'max_related' => 2, ',
  'api.membership.create' => 'some complex stuff to map membership id onto master id');

OR

civicrm_api3('membership', 'create', array(
  'contact_id' => 3,
  'membership_type_id' => 1,
  'max_related' => 2, ',
  'inherited_membership_contacts' => array(2,4);

I can't think on a non-ugly way.
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: What should creating related memberships look like with 'num_related'
September 29, 2013, 05:56:16 pm
Hmm - I think I should go with

civicrm_api3('membership', 'create', array(
  'contact_id' => 3,
  'membership_type_id' => 1,
  'max_related' => 2, ',
  'inherited_by_contacts' => array(2,4);

I don't think there is a non-ugly option
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: What should creating related memberships look like with 'num_related'
September 30, 2013, 12:01:41 am
Agree. Ansd how do we deal with the AJAX calls? X, can you shed some light on that aspect?
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

LoganBear

  • I post occasionally
  • **
  • Posts: 44
  • Karma: 1
  • CiviCRM version: 4.5.5
  • CMS version: Drupal 7.34
  • MySQL version: 5.1.67
  • PHP version: 5.3.28
Re: What should creating related memberships look like with 'num_related'
December 30, 2013, 10:10:42 am
Greetings y'all,

Can someone please explain what 'inherited_membership_contacts' is and how it's used?  I haven't seen any documentation on this.

Thank you.

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: What should creating related memberships look like with 'num_related'
December 30, 2013, 01:41:04 pm
pretty sure that is the field that shows the parent membership id for an inherited membership - ie, the on-behalf of org functionality in the membership pages
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • What should creating related memberships look like with 'num_related'

This forum was archived on 2017-11-26.