Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Look into making models persistent #7

Closed
m4tthumphrey opened this issue Apr 19, 2013 · 0 comments
Closed

Look into making models persistent #7

m4tthumphrey opened this issue Apr 19, 2013 · 0 comments

Comments

@m4tthumphrey
Copy link
Contributor

use Gitlab\Client;
use Gitlab\Model\Project;
use Gitlab\Model\Issue;

$client = new Client('http:https://git.yourdomain.com/api/v3/'); // change here
$client->authenticate('your_gitlab_token_here', Client::AUTH_URL_TOKEN); // change here

$project = new Project($client);
$project->name = 'A project';
$project->description = 'This is a project';
$project->save();

The following block

$issue = new Issue($client);
$issue->title = 'This is an issue';
$issue->addLabel('bug');
$issue->save();

$project->addIssue($issue);
// or
$issue->project = $project;

would be the same as

$project->createIssue('This is an issue', array(
    'labels' => array('bug')
));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants