You are here

function alchemy_new_alchemy_obj in Alchemy 7

Same name and namespace in other branches
  1. 6 alchemy.module \alchemy_new_alchemy_obj()

@todo Please document this function.

See also

http://drupal.org/node/1354

1 call to alchemy_new_alchemy_obj()
alchemy_get_elements in ./alchemy.module
@todo Please document this function.

File

./alchemy.module, line 223
$Id: alchemy.module,v 1.1.2.3 2010/11/17 21:17:48 tomdude48 Exp $

Code

function alchemy_new_alchemy_obj() {
  static $alchemy_obj;
  if ($alchemy_obj) {
    return $alchemy_obj;
  }

  // Load the AlchemyAPI module code.
  if (!alchemy_include_alchemy_class()) {
    return FALSE;
  }

  // Create an AlchemyAPI object.
  $alchemy_obj = new AlchemyAPI();
  $apikey = alchemy_get_apikey();
  if (!$apikey) {
    return FALSE;
  }
  $alchemy_obj
    ->setAPIKey($apikey);
  return $alchemy_obj;
}