Skip to content

Instantly share code, notes, and snippets.

@amitaibu
Created December 11, 2012 12:34
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 amitaibu/4258246 to your computer and use it in GitHub Desktop.
Save amitaibu/4258246 to your computer and use it in GitHub Desktop.
$values = array(
'uid' => 1,
'type' => 'school',
'title' => time(),
);
$group = entity_create('node', $values);
node_save($group);
$values = array(
'uid' => 1,
'type' => 'article',
'title' => time(),
);
$node = entity_create('node', $values);
node_save($node);
og_group('node', $group->nid, array('entity_type' => 'node', 'entity' => $node));
//dpm($group->nid, 'group');
dpm($node->nid, 'content');
node_delete($group->nid);
$queue = DrupalQueue::get('og_membership_orphans');
$item = $queue->claimItem();
og_membership_orphans_worker($item);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment