Skip to content

Instantly share code, notes, and snippets.

@totten
Created November 5, 2020 10:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save totten/b405a10cd82f35d125d64c792786d6f1 to your computer and use it in GitHub Desktop.
Save totten/b405a10cd82f35d125d64c792786d6f1 to your computer and use it in GitHub Desktop.
<?php
function groupCreate($params) {
$params = array_merge([
'name' => 'Test Group 1',
'domain_id' => 1,
'title' => 'New Test Group Created',
'description' => 'New Test Group Created',
'is_active' => 1,
'visibility' => 'Public Pages',
'group_type' => [
'1' => 1,
'2' => 1,
],
], $params);
return civicrm_api3('Group', 'create', $params);
}
$r = groupCreate([
'name' => 'Test Group 1108.1',
'title' => 'Test Group 1108.1',
]);
print_r($r);
$r2 = groupCreate([
'name' => 'Test Group 1108.2',
'title' => 'Test Group 1108.2',
]);
print_r($r2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment