Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
C
Core
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 924
    • Issues 924
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Operations
    • Operations
    • Incidents
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
  • Development
  • Core
  • Issues
  • #1705

Closed
Open
Opened Apr 15, 2020 by eileen@eileen🎱Owner

APIv4 - how do I interact with option values???

In apiv3 I can filter on an option value by passing in the name. So

civicrm_api3('Contribution', 'get', ['contribution_status_id' => 'Pending'])

will retrieve me Pending contributions. By the same token the v3 api returns me the status of the contributions.

In the api explorer I don't see a way to do that. I DO see a way to JOIN the optionValue table in - but that literally joins the table in from the looks of so I would wind up with an unindexed join in my query

Screen_Shot_2020-04-15_at_1.57.36_PM

@colemanw I know you hate the apiv3 double loading but what is the apiv4 expectation here? I really don't want to have to do endless CRM_Core_PseudoConstant::getKey() calls on every line....

Edited Apr 15, 2020 by eileen
To upload designs, you'll need to enable LFS and have admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: dev/core#1705