Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • C CiviCRM Core
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,372
    • Issues 1,372
    • List
    • Boards
    • Service Desk
    • Milestones
  • Deployments
    • Deployments
    • Releases
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Development
  • CiviCRM Core
  • Issues
  • #2046

Closed
Open
Created 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
Time tracking