Taskwarrior/README.md

1.0 KiB

Taskwarrior PHP lib

Build Status

WOW

Install

composer require 'davidbadura/taskwarrior'

Requirements: Taskwarrior >=2.1

Usage

use DavidBadura\Taskwarrior\TaskManager;
use DavidBadura\Taskwarrior\Task;
use DavidBadura\Taskwarrior\Recurring;

$tm = TaskManager::create();

$task = new Task();
$task->setDescription('program this lib');
$task->setProject('hobby');
$task->setDue('tomorrow');
$task->setPriority(Task::PRIORITY_HIGH);
$task->addTag('next');
$task->setRecurring(Recurring::DAILY);

$tm->save($task);

$tasks = $tm->filter('project:hobby'); // one task

$tm->done($task);

$tasks = $tm->filter('project:hobby'); // empty

$tasks = $tm->filterByReport('waiting'); 

API

todo...

QueryBuilder

$tasks = $taskManager->createQueryBuilder()
    ->whereProject('hobby')
    ->orderBy(['entry' => 'DESC'])
    ->getResult()