2015-02-06 07:26:04 -06:00
|
|
|
# Taskwarrior PHP lib
|
2015-02-05 13:41:03 -06:00
|
|
|
|
2015-02-05 13:47:39 -06:00
|
|
|
[![Build Status](https://travis-ci.org/DavidBadura/Taskwarrior.svg?branch=master)](https://travis-ci.org/DavidBadura/Taskwarrior)
|
2015-02-05 13:44:44 -06:00
|
|
|
|
2015-02-06 07:26:04 -06:00
|
|
|
![WOW](http://i.imgur.com/mvSQh0M.gif)
|
|
|
|
|
2015-02-05 13:41:03 -06:00
|
|
|
```php
|
2015-02-06 11:31:13 -06:00
|
|
|
use DavidBadura\Taskwarrior\TaskManager;
|
|
|
|
use DavidBadura\Taskwarrior\Task;
|
2015-02-05 13:41:03 -06:00
|
|
|
|
2015-02-06 11:31:13 -06:00
|
|
|
$tm = TaskManager::create();
|
|
|
|
|
|
|
|
$task = new Task();
|
2015-02-06 06:09:01 -06:00
|
|
|
$task->setDescription('program this lib');
|
2015-02-06 06:08:13 -06:00
|
|
|
$task->setProject('hobby');
|
|
|
|
$task->setDue(new \DateTime('tomorrow'));
|
2015-02-06 11:31:13 -06:00
|
|
|
$task->setPriority(Task::PRIORITY_HIGH);
|
|
|
|
$task->addTag('next');
|
2015-02-05 13:41:03 -06:00
|
|
|
|
2015-02-06 05:38:54 -06:00
|
|
|
$tm->save($task);
|
2015-02-05 13:41:03 -06:00
|
|
|
|
2015-02-06 06:14:58 -06:00
|
|
|
$tasks = $tm->filter('project:hobby'); // one task
|
|
|
|
|
|
|
|
$tm->done($task);
|
|
|
|
|
|
|
|
$tasks = $tm->filter('project:hobby'); // empty
|
2015-02-05 13:41:03 -06:00
|
|
|
```
|