public function write($value) { if ($value === NULL) { $this->database->delProp($this->key, array($this->prop)); } else { $this->database->setProp($this->key, array($this->prop => $value)); } }
public static function getQuotaUiFunction(\Nethgui\System\DatabaseInterface $configDb) { $increments = array_unique(array_filter(array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 25, 30, 35, 40, 45, 50, 100, 150, 200, 250, 300, 350, 400, 450, 500, 600, 700, 800, 900, 1000, $configDb->getProp('dovecot', 'QuotaDefaultSize')), function ($x) { return (int) $x >= 1; })); sort($increments); $h = array(); foreach ($increments as $i) { $h[$i] = $i >= 10 ? $i / 10.0 . ' GB' : $i * 100 . ' MB'; } return $h; }