1. Go to this page and download the library: Download nspyke/ehive library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
nspyke / ehive example snippets
use EHive\ApiClient;
use EHive\Transport\Transport;
$transport = new Transport(
'your_client_id',
'your_client_secret',
'your_tracking_id'
);
$client = new ApiClient($transport);
$cache = new MyCache(); // which implements \Psr\SimpleCache\CacheInterface
$transport = new Transport(...);
$transport->setCache($cache);
$client = new ApiClient($transport);
$logger = new MyLogger(); // which implements \Psr\Log\LoggerInterface
$transport = new Transport(...);
$transport->setLogger($logger);
$client = new ApiClient($transport);
/** @var EHive\Domain\Comment\CommentsCollection $commentsCollection */
$commentsCollection = $client->getObjectRecordComments($objectRecordId, $offset = 0, $limit = 10);
/** @var EHive\Domain\Comment\Comment $comment */
// Create and set the object and its values via the public properties
$comment = new Comment();
...
$comment = $client->addObjectRecordComment($objectRecordId, $comment);
/** @var EHive\Domain\ObjectRecordTag\ObjectRecordTagsCollection $objectRecordTagsCollection */
$objectRecordTagsCollection = $client->getObjectRecordTags($objectRecordId);
/** @var EHive\Domain\ObjectRecordTag\ObjectRecordTag $objectRecordTag */
// Create and set the object and its values via the public properties
$tag = new ObjectRecordTag();
...
$objectRecordTag = $client->addObjectRecordTag($objectRecordId, $tag);
$objectRecordTag = $client->deleteObjectRecordTag($objectRecordId, ObjectRecordTag $tag);