public static function manager() { if (self::$manager) { return self::$manager; } return self::$manager = new Storage_Manager(); }
public static function db() { switch (self::$type) { case 'orm': return WS::env()->orm->vars; case 'storage': return Storage::manager()->vars; } }
static function initialize() { $dirs = Storage::manager()->vars()->select(Storage::manager()->vars()->create_query()->eq('vartype', 'dir')); array_unshift($dirs, 'Нет'); CMS_Vars_Storage_Entity::fields(array('vartype' => array('type' => 'select', 'caption' => 'Тип', 'items' => CMS::vars()->types()), 'parent_id' => array('type' => 'tree_select', 'caption' => 'Родитель', 'items' => $dirs), 'code' => array('caption' => 'Идентификатор', 'type' => 'varcode'), 'title' => array('type' => 'input', 'caption' => 'Комментарий', 'tagparms' => array('style' => 'width: 98%')), 'full' => array('type' => 'checkbox', 'caption' => 'Ограниченный доступ'))); }
protected function storage() { $name = $this->storage_name; return Storage::manager()->{$name}(); }