-
Notifications
You must be signed in to change notification settings - Fork 5
Getting started
lapistano edited this page Nov 16, 2012
·
6 revisions
There are a number of ways to get your hands on the sources of this module. Probably the most easy way is to use packagist.org. Since packagist uses composer to manage dependencies between libraries the connector should be listed as requirement.
"require": {
"liip/drupalconnectormodule": "*"
}Once added run composer to receive the sources.
$> php composer.phar installThis section is just a basic introduction. Visit the wiki for an extensive example.
The following code snippet represents a Drupal file (e.g. myModule.module).
<?php
use Liip\Drupal\Modules\DrupalConnector\Common;
use Liip\Drupal\Modules\DrupalConnector\Node;
function myModule_doSomething($nid)
{
$commonConnector = new Common();
$nodeConnector = new Node();
try {
$node = $nodeConnector->node_load($nid);
} catch (NodeException $e) {
$commonConnector->watchdog(
'myModule',
$e->getMessage(),
array($nid),
WATCHDOG_ERROR
);
}
}That's basically how the connector works. Just add it to your project and use it accordingly. No magic ;)