The contract feels quirky -- e.g.
* Who would guess that `markSelection()` defaults to `$action == 'unselect'`?
* What's the point of accepting `$entity_table` if it's never used?
Fortunately, this function is only called from `CRM_Contact_Page_AJAX::selectUnselectContacts`,
so it's fairly easy to audit and see that:
* The `$action` is always passed in -- it never relies on the default value.
* The `$entity_table` is never specified explicitly -- it always relies on the default value.
* @param string $cacheKey
* @param string $action
* Ex: 'select', 'unselect'.
- * @param array|int|NULL $cIds
+ * @param array|int|NULL $ids
* A list of contact IDs to (un)select.
* To unselect all contact IDs, use NULL.
- * @param string $entity_table
- * Ex: 'civicrm_contact'.
*/
- public function markSelection($cacheKey, $action = 'unselect', $cIds = NULL, $entity_table = 'civicrm_contact');
+ public function markSelection($cacheKey, $action, $ids = NULL);
/**
* Get the selections.
* @param array|int|NULL $cIds
* A list of contact IDs to (un)select.
* To unselect all contact IDs, use NULL.
- * @param string $entity_table
- * Ex: 'civicrm_contact'.
*/
- public function markSelection($cacheKey, $action = 'unselect', $cIds = NULL, $entity_table = 'civicrm_contact') {
+ public function markSelection($cacheKey, $action, $cIds = NULL) {
+ $entity_table = 'civicrm_contact';
+
if (!$cacheKey) {
return;
}