10 private $mailboxId =
null;
15 $this->mailboxId = $mailboxId;
27 public function set(array $items)
32 public function get(
string $key, $default =
null)
34 return $this->getData($key, $default);
39 $list = $this->
get(
'hashed', []);
40 return isset($list[$key]) ? $list[$key] :
null;
45 $key = Emoji::decode($key);
46 $list = $this->
get(
'all', []);
47 return isset($list[$key]) ? $list[$key] :
null;
50 private function has(
string $key)
52 return isset($this->data[$key]);
55 private function remove(
string $key)
57 if (isset($this->data[$key]))
59 unset($this->data[$key]);
63 private function reset()
68 private function getData(
string $key, $default =
null)
70 return $this->has($key) ? $this->data[$key] : $default;
73 private function setData($name, $value)
75 $this->data[$name] = $value;
78 private function group($items)
88 foreach ($items as $item)
90 $all[$item->getPath()] = $item;
91 $hashed[$item->getDirMd5()] = $item;
93 if ($item->isIncome())
98 if ($item->isOutcome())
108 if ($item->isDraft())
113 if ($item->isTrash())
120 $this->setData(
'all', $all);
121 $this->setData(
'income', $income);
122 $this->setData(
'outcome', $outcome);
123 $this->setData(
'spam', $spam);
124 $this->setData(
'trash', $trash);
125 $this->setData(
'draft', $draft);
126 $this->setData(
'hashed', $hashed);