You are here

function og_create_group in Organic groups 7

Callback to create a new OG group.

1 call to og_create_group()
og_get_group in ./og.module
Return a loaded group entity if exists or create a new one.

File

./og.module, line 1256
Enable users to create and manage groups with roles and permissions.

Code

function og_create_group($values = array()) {
  if ($entity = entity_load($values['entity_type'], array(
    $values['etid'],
  ))) {
    $entity = current($entity);

    // Add default values.
    $values += array(
      'state' => OG_STATE_ACTIVE,
      'created' => time(),
      'label' => og_entity_label($values['entity_type'], $entity),
    );
    return entity_create('group', $values);
  }

  // Entity couldn't be loaded.
  return FALSE;
}