You are here

function hosting_import_client in Hosting 7.4

Same name and namespace in other branches
  1. 5 client/hosting_client.module \hosting_import_client()
  2. 6.2 client/hosting_client.module \hosting_import_client()
  3. 7.3 client/hosting_client.module \hosting_import_client()

Helper function to generate new client node during import.

Parameters

string $name: Client name.

Return value

object The node object of the generated client.

1 call to hosting_import_client()
hosting_site_drush_context_import in site/hosting_site.drush.inc
Implements hook_drush_context_import().

File

client/hosting_client.module, line 693

Code

function hosting_import_client($name) {
  $client = hosting_get_client_by_uname($name);
  if (!$client) {
    $client = new stdClass();
    $client->type = 'client';
    $client->uid = 1;
    $client->title = trim($name);
    $client->status = 1;
    node_save($client);
  }
  return $client;
}