Extend 'managed' api to provide information about 'status'
We've had some discussion on chat about making the 'Managed' api more flexible - ie
- being able to retrieve a list of outstanding actions
- being able to selectively action them
- having the api figure out dependencies - either 'explicit' because the managed description declares them or 'implicit' using logic like 'create option groups before option values
- full support for apiv4
I've dug around in the code a little & my thiking is a first helpful refactor would be to make the Managed class build a full array of 'managed actions' rather than passing around 'todos' in a way that makes things unavailable outside the specific flow.
I think the number of rows in the 'managed' actions is not likely to be so great it would cause memory issues so I'm imaginging the property looking like
$this->managedActions = [
[$module-$name-$entity] => [
/// all the details from the module +
'id' => x, // if it exists in civicrm_managed
'required_action' => 'update'// or delete, create
],
]
Then we could start to add functions like getEntitiesToDelete
& iterate through them, rather than passing around $todos