if ($caseSubclauses) {
$clauses['case_id'][] = 'IN (SELECT id FROM civicrm_case WHERE ' . implode(' AND ', $caseSubclauses) . ')';
}
+ CRM_Utils_Hook::selectWhereClause($this, $clauses);
return $clauses;
}
* @inheritDoc
*/
public function apiWhereClause() {
- return array(
+ $clauses = array(
'id' => CRM_Contact_BAO_Contact_Permission::cacheSubquery(),
);
+ CRM_Utils_Hook::selectWhereClause($this, $clauses);
+ return $clauses;
}
}
*/
public function apiWhereClause() {
// Generate an acl clause for both contacts in the relationship
- return array(
+ $clauses = array(
'contact_id_a' => CRM_Contact_BAO_Contact_Permission::cacheSubquery(),
'contact_id_b' => CRM_Contact_BAO_Contact_Permission::cacheSubquery(),
);
+ CRM_Utils_Hook::selectWhereClause($this, $clauses);
+ return $clauses;
}
}
*/
public function apiWhereClause() {
// Prevent default behavior of joining ACLs onto the contact_id field
- return array();
+ $clauses = array();
+ CRM_Utils_Hook::selectWhereClause($this, $clauses);
+ return $clauses;
}
}
* @return array
*/
public function apiWhereClause() {
+ $clauses = array();
$fields = $this->fields();
$cidField = CRM_Utils_Array::value('contact_id', $fields);
if (CRM_Utils_Array::value('FKClassName', $cidField) == 'CRM_Contact_DAO_Contact') {
- return array(
- 'contact_id' => CRM_Contact_BAO_Contact_Permission::cacheSubquery(),
- );
+ $clauses['contact_id'] = CRM_Contact_BAO_Contact_Permission::cacheSubquery();
}
- return array();
+ CRM_Utils_Hook::selectWhereClause($this, $clauses);
+ return $clauses;
}
/**
->invoke(5, $type, $contactID, $tableName, $allGroups, $currentGroups, self::$_nullObject, 'civicrm_aclGroup');
}
+ /**
+ * @param string|CRM_Core_DAO $entity
+ * @param array $clauses
+ * @return mixed
+ */
+ public static function selectWhereClause($entity, &$clauses) {
+ $entityName = is_object($entity) ? _civicrm_api_get_entity_name_from_dao($entity) : $entity;
+ return self::singleton()->invoke(2, $entityName, $clauses,
+ self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject,
+ 'civicrm_selectWhereClause'
+ );
+ }
+
/**
* This hook is called when building the menu table.
*