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 (Moderator: Donald Lobo) »
  • Relationship GET API
Pages: [1]

Author Topic: Relationship GET API  (Read 822 times)

ruid

  • I post occasionally
  • **
  • Posts: 46
  • Karma: 4
Relationship GET API
September 20, 2009, 06:26:24 pm
We have civicrm_contact_relationship_get and civicrm_relationship_get functions to get relationship.

If I want to get all relationships with relationship type xxx for contact a, I have to use civicrm_relationship_get all relationships and find out the type xxx from them which will slow down the process. I had a look at civicrm_contact_relationship_get. It is doing the same thing.

Can we have a API to get relationship based on relationship id so we only get the relationships that we want instead of getting all of them?
The CRM_Contact_BAO_Relationship::getRelationship() might need to update to be able pass in the relationship type id.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Relationship GET API
September 20, 2009, 06:42:53 pm

Would be great if you can submit a patch that does the needful. Please also ensure that you submit unit tests to accompany the patch and needed changes.

check: http://wiki.civicrm.org/confluence/display/CRM/Setting+up+your+personal+testing+sandbox+HOWTO

for details on CiviCRM unit testing.

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Relationship GET API

This forum was archived on 2017-11-26.