Example #1
0
<?php

require_once __DIR__ . '/../../vendor/autoload.php';
use Linkorb\AnswersClient\Client;
use Linkorb\AnswersClient\Comment;
// get the client
$client = new Client('http://answers.dev/api/v1/', 'kishanio', '11121992');
$comment = new Comment($client);
$comment->get(5);
try {
    $comment->vote();
} catch (Exception $e) {
    echo $e->getMessage();
}
Example #2
0
<?php

require_once __DIR__ . '/../../vendor/autoload.php';
use Linkorb\AnswersClient\Client;
use Linkorb\AnswersClient\Comment;
// get the client
$client = new Client('http://answers.dev/api/v1/', 'kishanio', '11121992');
$comment = new Comment($client);
$comment->get(6);
try {
    $comment->delete();
} catch (Exception $e) {
    echo $e->getMessage();
}
Example #3
0
<?php

require_once __DIR__ . '/../../vendor/autoload.php';
use Linkorb\AnswersClient\Client;
use Linkorb\AnswersClient\Comment;
// get the client
$client = new Client('http://answers.dev/api/v1/', 'kishanio', '11121992');
$comment = new Comment($client);
$comment->get(6);
$comment->setComment('this is update comment for id 2?');
try {
    $comment->update();
} catch (Exception $e) {
    echo $e->getMessage();
}