feat: Converted vcalendar todo events to taskwarrior tasks

This commit is contained in:
Aerex
2020-05-12 23:56:22 -05:00
parent 45ea34da94
commit 40b66fb38b
13 changed files with 198 additions and 114 deletions

View File

@@ -3,7 +3,6 @@
namespace Aerex\BaikalStorage;
use Sabre\VObject\Component\VCalendar as Calendar;
use Aerex\BaikalStorage\Configs\ConfigBuilder;
class StorageManager {
@@ -15,13 +14,12 @@ class StorageManager {
/**
* @var Config
* @var array()
*/
private $configBuilder;
private $configs;
public function __construct($configBuilder){
$this->configBuilder = $configBuilder;
public function __construct($configs){
$this->configs = $configs;
}
public function getStorages() {
@@ -33,14 +31,9 @@ class StorageManager {
}
public function addStorage($name, $storage) {
$this->configBuilder->add($storage->getConfig());
$this->storages[$name] = $storage;
}
public function init() {
$this->configs = $this->configBuilder->loadYaml();
}
public function import(Calendar $calendar) {
if (!isset($this->configs)) {
throw new \Exception('StorageManger was not initialize or configs are not defined');
@@ -50,7 +43,6 @@ class StorageManager {
if (!isset($storage)){
throw new \Exception();
}
$storage->setRawConfigs($this->configs[$key]);
$storage->save($calendar);
}
}