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 933
    • Issues 933
    • 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
  • #2046

Closed
Open
Opened Sep 16, 2020 by eileen@eileen🎱Owner

Rationalise BAO create vs add functions

Back in the dawn of CiviCRM there was create and there was add and there was a theory behind them. Fast forward to today - there is still create & there is still add but not much sign of a theory behind them.

What has changed is that we no longer recommend either create is called directly

I proposed we set a goal (long term) to consolidate create & add functions into one function - with the functionality moved from add into create & add becoming a deprecated wrapper around create. The example I'm looking at is pretty straight forward - ie in Email BAO

  1. With this PR https://github.com/civicrm/civicrm-core/pull/18494 add is no longer called (seemingly not even in universe)
  2. the only thing create does that add doesn't is handlePrimary so there is a weak case for a separate add.

I'll put up a PR for the change to Email - to demo it - it doesn't turn out to be an easy merge I'll close it & continue to track here.

@colemanw @mattwire @monish.deb @seamuslee

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