예제 #1
0
<?php

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

require_once __DIR__ . '/../../vendor/autoload.php';
use Linkorb\AnswersClient\Client;
use Linkorb\AnswersClient\Question as Comment;
// get the client
$client = new Client('http://answers.dev/api/v1/', 'kishanio', '11121992');
$comment = new Comment($client);
$comment->get(6);
$votes = $comment->getVotes();
var_dump($votes);
예제 #3
0
<?php

require_once __DIR__ . '/../../vendor/autoload.php';
use Linkorb\AnswersClient\Client;
use Linkorb\AnswersClient\Question;
// get the client
$client = new Client('http://answers.dev/api/v1/', 'kishanio', '11121992');
$question = new Question($client);
$question->get(16);
try {
    $question->comment('this is some comment');
} catch (Exception $e) {
    echo $e->getMessage();
}
예제 #4
0
<?php

require_once __DIR__ . '/../../vendor/autoload.php';
use Linkorb\AnswersClient\Client;
use Linkorb\AnswersClient\Question;
// get the client
$client = new Client('http://answers.dev/api/v1/', 'kishanio', '11121992');
$question = new Question($client);
$question->get(8);
$answers = $question->getAnswers();
var_dump($answers);
$comments = $question->getComments();
var_dump($comments);
$votes = $question->getVotes();
var_dump($votes);