From 15300db995e87eff5e989b7ce8aebbbc093f5650 Mon Sep 17 00:00:00 2001 From: DavidBadura Date: Wed, 8 Jul 2015 13:41:05 +0200 Subject: [PATCH] update readme --- README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/README.md b/README.md index b089539..e3d05c9 100644 --- a/README.md +++ b/README.md @@ -157,6 +157,28 @@ reopen task: $tm->reopen($task); ``` +dependencies: + +```php +$task1 = new Task(); +$task1->setDescription('a'); + +$task2 = new Task(); +$task2->setDescription('b'); + +$task1->addDependency($task2); + +// the order is important! +$tm->save($task2); +$tm->save($task1); + +$tm->clear(); // clear object cache + +$task1 = $tm->find('uuid-from-task1'); +$task2 = $task1->getDependencies()[0]; +echo $task2->getDesciption(); // "b" <- lazy loading +``` + ### QueryBuilder example: