Skip to content
GitLab
  • Explore
  • Sign in
  • DevelopmentDevelopment
  • CiviCRM CoreCiviCRM Core
  • Issues
  • #2046

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
Time tracking